GNOME Bugzilla – Bug 577099
[discoverer] use gst.pbutils to also give codec/container human-friendly names
Last modified: 2011-01-28 13:12:41 UTC
It would be nice if the discoverer library in pygst could also provide the codec names for the audio and video. Often when you want size/lenght and similar information you at the same time want to know which codecs are used.
A trick we use in pitivi is to use the "gst.pbutils" module (plugins base utils), which is normally used for the missing plugins system, but you can also use parts of it to convert caps to 'human' description. In [1]: import gst In [2]: import gst.pbutils In [3]: gst.pbutils.get_codec_description(gst.Caps("video/mpeg, systemstream=True")) Out[3]: 'MPEG Video' The above example also shows that you can do that for container formats also ! :) discoverer should use this.
This info should also be in the *CODEC* tags.
But the caps displayed by discoverer do not seem to include any reference to the codecs used? The output of gst-discover is for instance: video caps: video/x-raw-yuv, format=(fourcc)I420, width=(int)352, height=(int)240, pixel-aspect-ratio=(fraction)10/11, framerate=(fraction)30000/1001 So getting the format name to something human readable I guess is a step 2 from actually getting the codec information at all?
Christian, imho gst-discover does not handle tags, gstfile.py imho does. While your at it, having a gtk-based discovery browser would be nice :)
Not sure if any of the proposed solutions actually work in the sense that it seems none of them returns enough information to actually be useful. On this wiki page I have listed the caps information needed to actually identify codecs and container formats: http://gstreamer.freedesktop.org/wiki/GstreamerCaps So to actually identify mp3 I need to get back 'audio/mpeg,mpegversion=1,layer=3' and not 'audio/mpeg' So what I would like is for discoverer to give me the full 'unique' caps string back for the codecs in the file discovered, so that I can use that information to decide if remuxing is possible for instance.
Created attachment 137930 [details] [review] Patch adding codec information gathering This patch implements the suggested added functionality
I am using pbutils manualy in gst-media info to get the human readable codec/container names and its fairly straight forward. I also use the internal media-type as a hashtable key to lookup other details, so that needs to be kept. I feel its easy enough to lookup the names if needed from the application using the discoverer api.
Actually this bug is redundant as the new C based discoverer does this. Closing.