Mixing multiple sources with different framerates

Mike Mitchell mike.mitchell at panometric.net
Wed Oct 5 06:54:17 PDT 2011


Eduardo,
Try adding a videorate element and queue to the end of each feed. It will
probably also require forcing the caps on videomixer so that videorate knows
what to match to. Videorate will duplicate or drop frames to sync the rates.
Using "videorate silence=false" will show you each time a frame is added or
dropped.  Remove it once you see it working.

The three queues will thread your three inputs up to videomixer2 sink.

I could not test this but here's a rough interpretation of my
recommendation. Good luck.

 gst-launch-0.10 \
 videomixer2 name=mix ! video/x-raw-yuv,width=1536,height=1056,
framerate=30/1 ! xvimagesink \
  v4l2src device="/dev/video0" ! video/x-raw-yuv,width=640,height=480 !
videoscale ! video/x-raw-yuv,width=512,height=384 ! ffmpegcolorspace ! \
    videobox border-alpha=0 top=-384 left=0 ! "videorate silence=false" !
queue ! mix. \
  v4l2src device="/dev/video1" ! video/x-raw-yuv,width=720,height=576 !
videoscale ! video/x-raw-yuv,width=512,height=384 ! ffmpegcolorspace ! \
    videobox border-alpha=0 top=0 left=0 ! "videorate silence=false" ! queue
! mix. \
  v4l2src device="/dev/video2" ! video/x-raw-yuv,width=1024,height=768 !
ffmpegcolorspace  ! \
     videobox border-alpha=0 top=0 left=-512 ! "videorate silence=false" !
queue ! mix.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videorate.html

*Mike Mitchell*
*
*



On Wed, Oct 5, 2011 at 3:56 AM, Eduardo Herraiz <edu at ifisc.uib-csic.es>wrote:

> Hi all,
>
> I am trying to mix 3 different sources with Gstreamer.
>
> I have 2 usb cams and a usb framegrabber capturing a VGA laptop exit.
> http://ifisc.uib-csic.es/~edu/screens_gstreamer/allsources.png
>
> It works, but with a very slow framerate. I suppose that is a problem with
> the different bitrates of the sources, because the framegrabber has a 10 fps
> an the others 25 fps.
> And in console I can see errors, every second, like this: "There may be a
> timestamping problem, or this computer is too slow."
> This is the command I used:
>  gst-launch-0.10 \
>  videomixer2 name=mix ! xvimagesink \
>   v4l2src device="/dev/video0" ! video/x-raw-yuv,width=640,height=480 !
> videoscale ! video/x-raw-yuv,width=512,height=384 ! ffmpegcolorspace ! \
>     videobox border-alpha=0 top=-384 left=0 ! mix. \
>   v4l2src device="/dev/video1" ! video/x-raw-yuv,width=720,height=576 !
> videoscale ! video/x-raw-yuv,width=512,height=384 ! ffmpegcolorspace ! \
>     videobox border-alpha=0 top=0 left=0 ! mix. \
>   v4l2src device="/dev/video2" ! video/x-raw-yuv,width=1024,height=768 !
> ffmpegcolorspace  ! \
>      videobox border-alpha=0 top=0 left=-512 ! mix.
>
> When I try without the slow source, seems to work properly.
> http://ifisc.uib-csic.es/~edu/screens_gstreamer/twosources.png
>
>
> I have no idea how to solve this and if is possible to merge, in a correct
> way, different sources with variable bitrates,
> Anybody knows?
>
> This link was helpful for me and I based my work on it:
>
> http://www.oz9aec.net/index.php/gstreamer/347-more-gstreamer-tips-picture-in-picture-compositing
>
> Thank you
> Edu
>
>
> --
> *****************************************************************
> Edu Herraiz - Web developer
> http://www.eduherraiz.com
>
> IFISC
> Instituto de Física Interdisciplinar y Sistemas Complejos (CSIC-UIB)
> email: edu at ifisc.uib-csic.es
> *****************************************************************
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111005/5058532e/attachment-0001.htm>


More information about the gstreamer-devel mailing list