Trying to use playbin2 with filesink.

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

Trying to use playbin2 with filesink.

it
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

Thanks in advance.

Regards

Steve

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

Re: Trying to use playbin2 with filesink.

michael smith-6-3
On Fri, Aug 12, 2011 at 12:39 PM, Steve <[hidden email]> 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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
it
Reply | Threaded
Open this post in threaded view
|

RE: Trying to use playbin2 with filesink.

it
Hi Mike,

Well thanks for that.  I need to have a think about what to do next.

Regarding your other points:

> you probably don't want to have a filename ending with 'mkv' if
> you're using ogg.

Yeah, I noticed that just after I sent it.  Really I want lossless
compression (maybe y4menc) and no licence problems.  I'm not really
clear what muxing is, or if I even need to have it.

> you want "framerate=(fraction)10/1" rather than fps=10.

Ok, thanks.

> the curly-braces are an obsolete part of the gst-launch syntax,
> you shouldn't use them.

It needs to be as near real-time as possible, so I hoped if I ran
the file storage in a different thread it might speed up the
camera-to-screen bit.  I have to say I don't notice any difference
Either way, so maybe it's redundent.

Anyway thanks for your help.

If you have any other thoughts about the above I'd like to hear
them.

Regards

Steve

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

Re: Trying to use playbin2 with filesink.

michael smith-6-3
On Fri, Aug 12, 2011 at 4:30 PM, Steve <[hidden email]> wrote:
>> the curly-braces are an obsolete part of the gst-launch syntax,
>> you shouldn't use them.
>
> It needs to be as near real-time as possible, so I hoped if I ran
> the file storage in a different thread it might speed up the
> camera-to-screen bit.  I have to say I don't notice any difference
> Either way, so maybe it's redundent.

The braces are ignored. They literally have no effect except to make
it harder to read your gst-launch syntax.

However, that would be running in a different thread anyway.

Mike
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
it
Reply | Threaded
Open this post in threaded view
|

RE: Trying to use playbin2 with filesink.

it
In reply to this post by michael smith-6-3
> -----Original Message-----
> Michael Smith wrote:
> Sent: 12 August 2011 18:19

> 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.
>
How would 'pause' work?  I assume it would pause the whole pipeline
including the filesave.  I need the filesave to be continuous and the
pause to work only on the screen sink.

What do you think?

Regards

Steve

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel