Streaming Picture in Picture H264 video from Raspberry Pi

Shantanu Gore gore.shantanu at gmail.com
Fri Mar 20 14:02:25 PDT 2015


UPDATE: I was able to get it to stream with almost no latency on the Pi's
output (ximagesink). All I need to do now is to send it over the network to
my Windows command. Could anyone suggest a way to do this? I tried simply
replacing ximagesink with udpsink, but I am unable to open the stream on
Windows (through both gstreamer and VLC). Thanks in advance for your help!

gst-launch-1.0 videomixer sink_0::ypos=200 sink_2::xpos=200  name=mixer !
videoconvert ! ximagesink v4l2src device=/dev/video0 !
video/x-h264,width=320,height=240 ! h264parse ! decodebin ! mixer. v4l2src
device=/dev/video1 ! video/x-h264,width=320,height=240,framerate=30/1 !
h264parse ! decodebin ! mixer.

Surprisingly, I was watching htop while the streams were playing, and there
barely seemed to be any load on the processors. I am using a Pi 2, and one
processor was at 15% while the others were around 4%. Could it be that the
Pi can indeed decode, mix, and encode the video streams? Or am I still
missing something?

Shantanu

On Fri, Mar 20, 2015 at 4:17 PM, Shantanu Gore <gore.shantanu at gmail.com>
wrote:

> Hi JM,
>
> Thanks a lot for your response! I indeed did not realize what videomixer
> was actually doing, and it makes sense now why it wasn't working. My end
> goal is to display video from all the cameras in a single window (either
> through gstreamer or VLC). Would mpegts be able to do something like that?
>
> I have actually experimented before with mpegtsmux and VLC, but I found
> that it is _extremely_ laggy (about 1 minute latency), and sometimes just
> stops working altogether. Here is the command I am using - I wasn't able to
> figure out how to completely remove videomixer from the equation:
>
> gst-launch-1.0 videomixer sink_0::ypos=300 sink_2::xpos=300  name=mixer !
> videoconvert ! x264enc tune=zerolatency ! mpegtsmux ! chopmydata
> max-size=9000 ! udpsink host=192.168.2.7 port=1234 v4l2src
> device=/dev/video0 ! video/x-h264,width=640,height=480,framerate=30/1 !
> h264parse ! decodebin ! mixer. v4l2src device=/dev/video1 !
> video/x-h264,width=800,height=600,framerate=30/1 ! h264parse ! decodebin !
> mixer.
>
> Shantanu
>
> On Fri, Mar 20, 2015 at 3:50 PM, Jean-Michel Hautbois <jhautbois at gmail.com
> > wrote:
>
>> Hi Shantanu,
>>
>> 2015-03-20 19:18 GMT+01:00 Shantanu Gore <gore.shantanu at gmail.com>:
>>
>>> Hi guys,
>>>
>>> I would like to stream multiple H264 (from Logitech C920s) streams from
>>> a Raspberry Pi to a Windows computer using GStreamer. So far, I have been
>>> able to stream a single video stream, using the following commands:
>>>
>>> Raspberry Pi Side:
>>> gst-launch-1.0 v4l2src device=/dev/video0 !
>>> video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! rtph264pay
>>> pt=127 config-interval=4 ! udpsink host=192.168.2.7
>>>
>>> Windows Side:
>>> C:\gstreamer\1.0\x86_64\bin>gst-launch-1.0 udpsrc ! application/x-rtp,
>>> payload=1
>>> 27 ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false
>>> text-overlay=false
>>>
>>> However, when I try to stream using a videomixer, it seems that the
>>> Raspberry Pi is processing the video somehow (perhaps due to my use of the
>>> videoconvert command), and thus I get extremely slow video and gstreamer
>>> complains that my computer (the Pi) isn't fast enough.
>>>
>>
>> If I understand correctly what you want to achieve, I think you are
>> misunderstanding what videomixer is doing.
>> It will mix uncompressed streams. So, from the pipeline you showed, you
>> will have v4l2src -> decoding -> videomixer -> encoding -> stream.
>> And the RPi is clearly not able to do that.
>>
>> You want to have multiple streams in one so, mpegts is one of your
>> answers.
>> And you will have one channel per h264 stream. I think it is doable with
>> the RPi.
>>
>> Regards,
>> JM
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
>
> --
> Thanks,
>
> Shantanu Gore
>



-- 
Thanks,

Shantanu Gore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150320/98a645db/attachment.html>


More information about the gstreamer-devel mailing list