Playing raw video files with playbin2
René Stadler
mail at renestadler.de
Tue Mar 15 04:45:29 PDT 2011
On Tue, Mar 15, 2011 at 1:59 AM, Joseph Thomson <joseph.thomson at gmail.com>wrote:
> I am relatively new to GStreamer, so please try to forgive my ignorance. I
> currently have an application that uses a playbin2 to stream video to an
> appsink element. All is well until I try to stream from a raw YUV file.
> The file has no header data (frame rate, resolution etc.), so I understand
> that nothing is going to happen unless I somehow specify this data. I know
> the file is CIF (352 x 288) and has a framerate of 25 fps, but I'm not sure
> how to go about telling the application this. All my attempts so far have
> been somewhat trial and error, and none of them have produced any results.
> Can anyone tell me how I should go about specifying these details manually,
> or if it is even possible?
>
Hi,
there isn't really much benefit to using playbin2 in this special use case.
Even if playbin2 were to support it, you would need a very special code path
anyways. A very simple pipeline to play such a file would be:
filesrc ! videoparse ! appsink
The videoparse element is from the "rawparse" plugin in gst-plugins-bad. You
can set properties on it, like the exact YUV format, width, height and
framerate. The element takes care of proper framing of the data and sets
caps and timestamps on the buffers for you. Use the command
gst-inspect-0.10 videoparse
for more information. If the data isn't coming from a file but e.g. from
http (you mention that you are streaming the file), replace filesrc with
souphttpsrc and maybe add a queue element for additional buffering. You can
also let GStreamer select the source element for you automatically; it will
be derived from the URL type and available plugins in your system (this is
also what playbin2 is doing):
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstUriHandler.html#gst-element-make-from-uri
--René Stadler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110315/bc934ef0/attachment.htm>
More information about the gstreamer-devel
mailing list