Tuesday, July 29, 2008

Continuing Encoding Profiles

Ok, thanks to my previous post comments, I changed the profile XML format. Now I'm not representing the pipeline on itself, but just describing how can be the elements to my program find elements in gstRegistry, and so connect them to construct a pipeline. The good point on this is to possible different elements, so gstms - gst-media-services, this project - can work in different devices, with different elements sets.

But, as nothing is so good, I have some new problems:
  • I need to guess some useful properties - this is needed to basic user interface, as if I show all possible elements properties will turn gstms too hard to use. I'm handling it telling some possible properties, if they don't exist, doesn't matter - let the default value be used. Also, I pretend to change the graphical interface of gstms to advanced mode, so in this mode user can set each property by hand, and here I can just read all possible properties and show on the interface.
  • Connections - how gstms can connect elements in a correct pipeline? I'm not 100% sure about this solution, but I'm only describing each possible-element source, so gstms can search for a element that fits on this source. Also, each possible-element can have, optionally, a tag named recommended-elements which recommends gstms to elements in gst that can be used. I'm not so sure about video conversions, I need to build one first.
  • audioconvert, ffmpegcolorspace - these two elements are always used in audio and video conversion, to change raw audio and raw video formats. But, is there any other element like this? Can I search automatically for them, with possibly another name? I didn't solve it.
Also, I'm fearing that gstms find some element which, for some unknown reason, doesn't work for a conversion. So, in this case, how can I handle it? And what about elements that are not encoders, like id3v2mux, how can I search for a possible element like this?

For who want to know how is going the xml format, here a link to websvn of google project. Please, comment, community opinions have being very useful to the project!

1 comment:

airmind said...

One way to use ffmpegcolorspace and audioconvert is to auto-plug the elements based on their capabilities. Imagine a video decoder outputting video/x-raw-yuv to an X video output, which only takes video/x-raw-rgb, so you look for an element that has video/x-raw-yuv on it's source capabilities and video/x-raw-rgb on it's sink capabilities, and link this element between the video decoder and the video output. This element will probably be ffmpegcolorspace.
I believe this is similar to what decodebin does, it identifies the file format, finds an element that can handle that format by it's capabilities, and find a decoder.

But I can see how this can get very complicated, so there could be an easier way, such as always linking them to their respective streams (so a video stream will always have a ffmpegcolorspace and an audio stream an audioconvert element). This is the way I'm doing with the GStreamer conversion for iPods in Conduit.

Btw, in what I'm doing, I need some pretty specific options to the Mpeg4 or H264 encoder to make sure the output file is compatible. I thought about making it generic enough to take any encoder availiable that outputs the necessary stream, but that doesnt allow me to specify these options.
Could you allow some parameters to be set to a specific element in the XML format? Or could you force an element into a pipeline?