2x2 videowall pipeline

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

2x2 videowall pipeline

David Balch
Hi,

I'm trying to combine four v4l2 webcam streams into one, and earlier
mails on the list* have been invaluable to my progress so far - my
thanks to the list!

I've managed to combine four test signals successfully with this:

gst-launch-0.10 videotestsrc pattern="snow" !
video/x-raw-yuv,width=320,height=240 ! queue ! videomixer name=mix !
ffmpegcolorspace ! autovideosink \
  videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
videobox left=-320 border-alpha=0  ! queue ! mix. \
  videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
! videobox top=-240 border-alpha=0 ! queue ! mix. \
  videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
videobox left=-320 top=-240 border-alpha=0 ! queue ! mix.


Directly switching out a videotestsrc for a v4l2src gives "ERROR: from
element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow
error. ", so with a bit of ffmpegcolorspace experimentation I can make
a pipeline that runs without error:

gst-launch-0.10 v4l2src device=/dev/video0 !
video/x-raw-yuv,width=320,height=240 ! queue ! videomixer name=mix !
ffmpegcolorspace ! autovideosink \
  videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
! videobox left=-320 border-alpha=0 ! ffmpegcolorspace ! queue ! mix.
\
  videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
videobox top=-240 border-alpha=0 ! ffmpegcolorspace ! queue ! mix. \
  videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
videobox left=-320 top=-240 border-alpha=0 ! ffmpegcolorspace ! queue
! mix.

Unfortunately, the webcam doesn't actually show - it's corner is just
black. (The webcam works with "gst-launch-0.10 v4l2src
device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !
autovideosink".)


Any ideas why the webcam doesn't appear, and how to fix it?

Cheers,
Dave.

*e.g. http://gstreamer-devel.966125.n4.nabble.com/Videomixing-two-multiple-webcams-side-by-side-td2197804.html

--
http://www.witchesband.com/

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: 2x2 videowall pipeline

Luciana Fujii Pontello
On Thu, 2010-11-18 at 15:40 +0000, David Balch wrote:
> Hi,

> gst-launch-0.10 v4l2src device=/dev/video0 !
> video/x-raw-yuv,width=320,height=240 ! queue ! videomixer name=mix !
> ffmpegcolorspace ! autovideosink \
>   videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
> ! videobox left=-320 border-alpha=0 ! ffmpegcolorspace ! queue ! mix.
> \
>   videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
> videobox top=-240 border-alpha=0 ! ffmpegcolorspace ! queue ! mix. \
>   videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
> videobox left=-320 top=-240 border-alpha=0 ! ffmpegcolorspace ! queue
> ! mix.
>
> Unfortunately, the webcam doesn't actually show - it's corner is just
> black. (The webcam works with "gst-launch-0.10 v4l2src
> device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !
> autovideosink".)

It seems like the property border-alpha is not working for you because
your video doesn't have alpha channel. Add an alpha element in every
video like this: videotestsrc pattern="blue" !
video/x-raw-yuv,width=320,height=240 ! alpha ! videobox top=-240
border-alpha=0 ! queue ! mix.

(I think you can remove some of the colorspaces as well)

Regards,

Luciana Fujii

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: 2x2 videowall pipeline

David Balch-2
Brilliant!

This now works:

gst-launch-0.10 v4l2src device=/dev/video0 !
video/x-raw-yuv,width=320,height=240 ! alpha ! queue ! videomixer
name=mix ! ffmpegcolorspace ! autovideosink \
  videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
! alpha ! videobox left=-320 border-alpha=0 ! queue ! mix. \
  videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
alpha ! videobox top=-240 border-alpha=0 ! queue ! mix. \
  videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
alpha ! videobox left=-320 top=-240 border-alpha=0 ! queue ! mix.

Thanks Luciana! :-D

I only have one cam with me at the moment, but hopefully I'll be able
to add more without too much trouble. I'll let you know how I get
on...

Cheers,
Dave.

On 18 November 2010 16:06, Luciana Fujii Pontello
<[hidden email]> wrote:

> On Thu, 2010-11-18 at 15:40 +0000, David Balch wrote:
>> Hi,
>
>> gst-launch-0.10 v4l2src device=/dev/video0 !
>> video/x-raw-yuv,width=320,height=240 ! queue ! videomixer name=mix !
>> ffmpegcolorspace ! autovideosink \
>>   videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
>> ! videobox left=-320 border-alpha=0 ! ffmpegcolorspace ! queue ! mix.
>> \
>>   videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
>> videobox top=-240 border-alpha=0 ! ffmpegcolorspace ! queue ! mix. \
>>   videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
>> videobox left=-320 top=-240 border-alpha=0 ! ffmpegcolorspace ! queue
>> ! mix.
>>
>> Unfortunately, the webcam doesn't actually show - it's corner is just
>> black. (The webcam works with "gst-launch-0.10 v4l2src
>> device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !
>> autovideosink".)
>
> It seems like the property border-alpha is not working for you because
> your video doesn't have alpha channel. Add an alpha element in every
> video like this: videotestsrc pattern="blue" !
> video/x-raw-yuv,width=320,height=240 ! alpha ! videobox top=-240
> border-alpha=0 ! queue ! mix.
>
> (I think you can remove some of the colorspaces as well)
>
> Regards,
>
> Luciana Fujii
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



--
http://www.witchesband.com/

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: 2x2 videowall pipeline

David Balch
Hi,

I've borrowed two cameras to give me a total of four, and it works :-)
Here's the pipeline:

gst-launch-0.10 v4l2src device=/dev/video0 !
video/x-raw-yuv,width=320,height=240,framerate=30/1 ! alpha ! queue !
videomixer name=mix ! ffmpegcolorspace ! \
  xvimagesink sync=false \
  v4l2src device=/dev/video1 !
video/x-raw-yuv,width=320,height=240,framerate=30/1 ! alpha ! videobox
left=-320 border-alpha=0 ! queue ! mix. \
  v4l2src device=/dev/video2 !
video/x-raw-yuv,width=320,height=240,framerate=30/1 ! alpha ! videobox
top=-240 border-alpha=0 ! queue ! mix. \
  v4l2src device=/dev/video3 !
video/x-raw-yuv,width=320,height=240,framerate=30/1 ! alpha ! videobox
left=-320 top=-240 border-alpha=0 ! queue ! mix.

Thanks again for your help :-)

There are some pictures on
http://occasionalrandoms.blogspot.com/2010/11/webcam-videowall.html.

Cheers,
Dave.

--
http://www.witchesband.com/

lch <[hidden email]> wrote:

> Brilliant!
>
> This now works:
>
> gst-launch-0.10 v4l2src device=/dev/video0 !
> video/x-raw-yuv,width=320,height=240 ! alpha ! queue ! videomixer
> name=mix ! ffmpegcolorspace ! autovideosink \
>  videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
> ! alpha ! videobox left=-320 border-alpha=0 ! queue ! mix. \
>  videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
> alpha ! videobox top=-240 border-alpha=0 ! queue ! mix. \
>  videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
> alpha ! videobox left=-320 top=-240 border-alpha=0 ! queue ! mix.
>
> Thanks Luciana! :-D
>
> I only have one cam with me at the moment, but hopefully I'll be able
> to add more without too much trouble. I'll let you know how I get
> on...
>
> Cheers,
> Dave.
>
> On 18 November 2010 16:06, Luciana Fujii Pontello
> <[hidden email]> wrote:
>> On Thu, 2010-11-18 at 15:40 +0000, David Balch wrote:
>>> Hi,
>>
>>> gst-launch-0.10 v4l2src device=/dev/video0 !
>>> video/x-raw-yuv,width=320,height=240 ! queue ! videomixer name=mix !
>>> ffmpegcolorspace ! autovideosink \
>>>   videotestsrc pattern="green" ! video/x-raw-yuv,width=320,height=240
>>> ! videobox left=-320 border-alpha=0 ! ffmpegcolorspace ! queue ! mix.
>>> \
>>>   videotestsrc pattern="blue" ! video/x-raw-yuv,width=320,height=240 !
>>> videobox top=-240 border-alpha=0 ! ffmpegcolorspace ! queue ! mix. \
>>>   videotestsrc pattern="red" ! video/x-raw-yuv,width=320,height=240 !
>>> videobox left=-320 top=-240 border-alpha=0 ! ffmpegcolorspace ! queue
>>> ! mix.
>>>
>>> Unfortunately, the webcam doesn't actually show - it's corner is just
>>> black. (The webcam works with "gst-launch-0.10 v4l2src
>>> device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !
>>> autovideosink".)
>>
>> It seems like the property border-alpha is not working for you because
>> your video doesn't have alpha channel. Add an alpha element in every
>> video like this: videotestsrc pattern="blue" !
>> video/x-raw-yuv,width=320,height=240 ! alpha ! videobox top=-240
>> border-alpha=0 ! queue ! mix.
>>
>> (I think you can remove some of the colorspaces as well)
>>
>> Regards,
>>
>> Luciana Fujii
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and  rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today
>> http://p.sf.net/sfu/msIE9-sfdev2dev
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
>
>
> --
> http://www.witchesband.com/
>



--
http://www.witchesband.com/

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel