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!

Saturday, July 19, 2008

Starting Encoding Profiles

Two weeks without reporting, but here I am. I spent this time with implementing the proposed interface, which I did all in glade format and I can easily edit it. Also, the project is detecting format - oh, I spent some hours implementing my own pipeline with decodebin to get info from files in the input and just later I found gst.extend.discoverer... ok, now I have more experience with pipelines, and I'm working in the xml format - I really don't know for now how can I represent the pipelines for themselves, as they need some processing power. For an example, to encode to mp3 I can use id3mux or id3v2mux, but to choose one I need to tell to try each. I saw the method of Banshee, using S-expression, is very useful but I would like to use only XML, just not sure exactly how.

A way that I was thinking is like:
<element id="audioconvert" type="required">
<element id="lame" type="required">
<property id="bitrate" type="optional">
<property id="vbr" type="">
<if expression="vbr!=0"> <!-- vbr!=0 need to use html encoded chars -->
<property>
</property>
</if>
<if expression="vbr != 0">
<element id="xingmux" type="optional">
<element id="id3v2mux" type="optional">
<else>
<if expression="exist(id3v2mux)">
<element id="id3v2mux" type="optional">
<elif expression="exist(id3mux)">
<element id="id3mux type=">
</element>
</elif>

Suggestions?

update: I corrected the XML code which was not appearing.

Sunday, July 6, 2008

A dialog proposal for conversions

I made a simple UI dialog for gst-media-services, as the following (and at the wiki):

  • Files to convert: is a list that user can add or remove files with the right-side buttons, where user can add any number of files to input them. I'm not sure if that way is understandable to the user that he can choose many files to do a batch operation or he can choose audio and/or video and/or images to mix them. When a file is added, the list can have the properties on it to set properties of the mix (like in what time it should be shown, for how much time if is a image, what is it volume if is a sound, and so on). Not intented to be released at a first time, the input could be a stream or an URI address, considering any stream too.

  • Video Output: here user (or the application which uses this dialog) choose the video format, based in the Encoding Profiles. Each profile has some properties, which is under discussion at the EncodingProfiles section. The default option depends of the input, the selected files: If user choose only audio files, the video appears as "No Video" (better is to disable it). If he choose a video, this box goes to a "maintain the same format" option, considering that there weren't any application which called the dialog with a format input. If user choose many videos, the dialog counts how much videos have of each format and the major format is the selected, so user can convert the minority videos to the majority format. If user choose videos and images, audios and videos, audios videos and images together, or just images, it's a mix case and dialog can handle this by showing some advanced options for each file selected.

  • Audio Output: default is to let the same audio. When user choose a video format, the audio choose the video-audio's profile, as I'm planning that all videos links audio profiles for its audio part. A "No Audio" option need to be done too.

  • Target folder: Where the results should be dropped. - problem with the mix operation: how can I presume what is the name of resulting file? Should I add another field for it if I detect a mix case?

  • Bottom Buttons: Edit profiles is a button to open the Profiles Editor, a tool that I want to do later, to help users to build their own profiles. At least, this button can let the user build its own pipeline, or change a pre-defined one. Transcode button transcode the files (is it the best name? Should I use Convert / Extract / Mix depending of selected operation?), and appear two new buttons when the operation is finished: "Close" and "Open target". A progress screen should appear when the transcode button is pressed.

I think I'll not change very much this dialog, and my wish is to offer this to applications to use it. I didn't cover some use cases yet, like when dialog do conversions or to just return the Gstreamer pipeline to the application which is calling gst-media-services. I'm already implementing the basic functions for the dialog, but I need to work in a XML parser for EncodingProfiles too.
Any suggestions, just drop in comments!