Trying to use playbin2 with filesink.

Michael Smith msmith at xiph.org
Fri Aug 12 14:19:10 PDT 2011


On Fri, Aug 12, 2011 at 12:39 PM, Steve <it at sca-uk.com> wrote:
> Hi People,
>
> I'm trying to give some care to a complex video application component that
> uses GStreamer in the following way:
>
> gst-launch playbin2 uri=file:///home/steve/vid_tmp.mkv
>
> or
>
> gst-launch playbin2 uri=v4l2:///dev/video0
>
> Because it also has a large installed base, I don't want to change the
> fundamental way it works (ie playbin).  But I do want to add a filesink
> to it, so that I can save the video when it is being used in v4l2 mode.
> I was hoping to use something like this:
>
> gst-launch playbin2 uri=v4l2:///dev/video0 ! tee name=videosave ! \
> videosave. ! {queue ! videorate ! video/x-raw-yuv,fps=10 ! \
> queue ! theoraenc  ! \
> queue ! muxout. oggmux name=muxout ! filesink location=vid_tmp.mkv }
>
> But I get:
>
> WARNING: erroneous pipeline: link without source element

That's right. playbin2 has no source or sink pads - it's entirely
self-contained. There's no nice way to do what you want here.

If you're really stuck with using playbin2 for this, you can create a
bin that contains your tee, the encoder, etc, as well as the normal
videosink, and set that as the video-sink property on playbin2. Pretty
ugly, but should be possible.

Some notes on the particular pipeline fragments you've got there:
  - you probably don't want to have a filename ending with 'mkv' if
you're using ogg.
  - you want "framerate=(fraction)10/1" rather than fps=10.
  - the curly-braces are an obsolete part of the gst-launch syntax,
you shouldn't use them.

Mike


More information about the gstreamer-devel mailing list