DeviceProfile

Device Profiles

To create the higher level device profiles we start from the XML format defined in the Arista transcoder. There are a few changes in the XML example below though from what Arista does today. First of all we replace all element names with GStreamer Caps and secondly we replace all element attribute settings with preset calls. Finally we expand the XML format to include all allowed choices for a given device, so that the application can offer the user other valid choices if they want to. Many GStreamer Caps are listed in the GstreamerCaps list.

To try to keep the discussion clear we always refer to these files as 'profiles' and the element specific GStreamer files as 'presets'. The presets called in this XML file in each pass are discussed in PresetDesign

<?xml version="1.0"?>

<device>
    <make>Apple</make>
    <model>iPod</model>
    <description>Profile for Apple iPod / iPhone</description>
    <author>
        <name>Joe Example</name>
        <email>mr.example@example.org</email>
    </author>
    <version>1.0</version>
    <icon>file://ipod.svg</icon>
    <default>Normal</default>
    
    <profiles>
        <profile>
            <name>Low</name> # This is a low quality output setting
            <container>video/quicktime,variant=apple</container>
            <extension>m4v</extension>
            <audio>
                <name>audio/mpeg,mpegversion=4</name>
                <presets>
                    <preset>Quality Low</preset>
                    <preset>Profile Low Complexity</preset>
                 </presets>
                <channels>1, 2</channels>
                <samplerate>44100</samplerate>
            </audio>
            <video>
                <name>video/x-h264</name>
                <border>N</border>
                <passes>1</passes>
                    <presets>
                        <preset>Quality Low</preset>
                        <preset>Profile Baseline</preset>
                    </presets>
                <width>320, 640</width>
                <height>240, 480</height>
                <framerate>1, 25</framerate>
            </video>
        </profile>
        <profile>
            <name>Normal</name>
            <container>video/quicktime,variant=apple</container>
            <extension>m4v</extension>
            <audio>
                <name>audio/mpeg,mpegversion=4</name>
                <presets>
                    <preset>Quality Normal</preset>
                    <preset>Profile Low Complexity</preset> 
                </presets>
                <channels>1, 2</channels>
                <samplerate>44100</samplerate>
            </audio>
            <video>
                <name>video/x-h264</name>
                <border>N</border>
                <passes>2</passes> # Number of passes in multipass encoding
                <presets>
                    <preset>Quality Normal</preset>
                    <preset>Profile Baseline</preset>
                </presets>
                <width>320, 640</width>
                <height>240, 480</height>
                <framerate>1, 30</framerate>
            </video>
        </profile>
    </profiles>
</device>

The general idea here is that you can combine any number of GStreamer element presets to build the device profile. They are set in the order specified (e.g. if quality_normal sets bframes=3 and then you set profile_baseline which sets bframes=0, you will get bframes=0, so it's always a good idea to put quality values before codec profile values).

Using this simple format the profiles for PSP, Nokia devices, the computer, etc are almost identical to the above and require no further modifications to the element presets.

One question which needs further thought it how to deal with variations within a device type, maybe 'iPod' is too generic for instance. We could also add another gstreamer preset for varation values if needed.

Also - what about handling multiple passes - the above can handle it by defining more <pass> elements but we'd need element profiles like e.g. 'quality_normal_2pass' and I guess setting a bitrate.

We also need to come up with a nice, but hopefully not to verbose way of including information about all supported codecs and containers formats in addition to our recommended one.

Comments

This proposal is being discussed on the GNOME Multimedia mailing list

To reach the archive go here

Comments on the proposal should be sent there. The comments below will be moved to the mailing list and removed from the wiki. So do not add more comments here.