On Tue, Mar 15, 2011 at 1:59 AM, Joseph Thomson <span dir="ltr"><<a href="mailto:joseph.thomson@gmail.com">joseph.thomson@gmail.com</a>></span> wrote:<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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?<br>
</blockquote><div><br></div><div>Hi,</div><div><br></div><div> 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:</div>
<div><br></div><div> filesrc ! videoparse ! appsink</div><div><br></div><div>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</div>
<div><br></div><div> gst-inspect-0.10 videoparse</div><div><br></div><div>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):</div>
<div><br></div><div> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstUriHandler.html#gst-element-make-from-uri">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstUriHandler.html#gst-element-make-from-uri</a></div>
<div><br></div><div>--René Stadler</div></div>