Multiple webcam streaming over network using raspberrypi3

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple webcam streaming over network using raspberrypi3

Mike-Maverick
Hi,

Can anyone please help me out in writing a pipeline in which I will be able
to use two webcams to stream data over the network using TCP.
I am currently using this pipeline for single webcam transmission and it
works fine.

*gstreamer pipeline -transmission
gst-launch-1.0 -v v4l2src ! video/x-raw, framerate=15/1, width=640,
height=480 ! omxh264enc ! rtph264pay config-interval=1 pt=96 ! gdppay !
tcpserversink host=192.168.0.100 port=5002

receiver pipeline
gst-launch-1.0 tcpclientsrc host=192.168.0.100 port=5002 ! gdpdepay !
rtph264depay ! avdec_h264 ! videoconvert ! ximagesink sync=false*

Please help, I am trying to figure this out from past 1-month using
different methods mentioned on the internet and no success till now.

Thank you




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multiple webcam streaming over network using raspberrypi3

Eric M
You won't be able to use the hardware encoder (omxh264enc) in more than one
stream at a time.  I'd use a software encoder (like avdec_h264 )  on one (or
both) of your streams.  You may need to use something like mjpeg encoding
since it is less CPU intensive than h264 (but it will use more bandwidth).

Something like this works for me:

gst-launch-1.0 rpicamsrc preview=0 !
image/jpeg,width=640,height=480,framerate=30/1 ! queue
max-size-time=50000000 leaky=upstream ! jpegparse ! rtpjpegpay  ! udpsink
host=192.168.1.169 port=9000 sync=false

udpsrc port=9000 caps=application/x-rtp retrieve-sender-address=false !
rtpjpegdepay ! jpegdec ! queue ! glupload ! glcolorconvert ! glimagesink

If you use "gst-inspect-1.0 | grep 264" you can pull up a list of h264
related plugins.  Then to see what each plugin accepts or outputs you can
run "gst-inspect-1.0 pluginname" to help you chain together a working
pipeline.

If you are using the onboard webcam, check out rpicamsrc as an alternative
to v4l2src:
https://github.com/thaytan/gst-rpicamsrc



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multiple webcam streaming over network using raspberrypi3

Mike-Maverick
Hi Eric and Thanks for the info.

*I am using 3 USB webcams from Logitech and I need a pipeline to transmit
all the feed in real time over the network using UDP or TCP. Like it should
be muxed.*

Can you please help me in writing that pipeline or do you have any example
to which I can refer and write it down by myself.
I need info on both TX and RX pipeline



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multiple webcam streaming over network using raspberrypi3

Eric M
The USB port can be a bottleneck on the Pi, but as long as the resolution and
frame rate isn't too high (15 FPS 640x480 sounds fine), and you stick to
something that isn't cpu intensive like mjpeg encoding you should be able to
pull it off.

I'd probably avoid muxing anything on the Pi side, it's generally kinda CPU
power limited as it is.

I suppose you could try muxing all three webcams together into a split
screen layout, and then compressing that once on the pi via the hardware
encoder, but then you lose the ability to individually save the streams on
the receiving end, and I don't think it will help you performance wise.

I'd make sure you are running the newer Raspbian Stretch releases, it has
gstreamer 1.10 in the repositories (sudo apt-get install gstreamer1.0),
otherwise you are stuck with the older 1.4 on Jessie.

I'd probably use UDP streaming for minimal latency and overhead, using a
pipeline like I showed you above.  Run it three times on the Pi, once for
each v4l2src.  On the receive side you can use three pipelines to save three
files, or use one pipeline with a videomixer to do a split screen display
(tee it and also save the files).

This cheat sheet has examples of using a videomixer:
http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multiple webcam streaming over network using raspberrypi3

Mike-Maverick
Hi Eric,

Thanks for the reply.

My task is to just stream it over the internet or to be specific at 2.4ghz.
We are not going to save the feed at any point.

Can you please tell me any software h264 encoder which i can use in the
pipeline.

can you wirte the stream for me for multiple webcam, its getting difficult
and i am not able to do it .

As per the previous example you said, i am using a webcam and not a picam.

Thanks



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel