I'm trying to write a simple command line audio player using the Python Gstreamer bindings. Is there a function in the gstreamer API that determines in advance whether or not a particular file (URI) can be decoded and played by the currently installed set of codecs?
A:
I guess you can try to play it and see if that raises any error - in fact, there's no way to know the set of codecs necessary without opening the file. Some distributions even have hooks in place that ask the user to download the right codec when you start playing something.
nosklo
2010-01-08 10:14:04
It's true that you must open the file - because the encoding can sometimes be independent of the filetype (e.g ogg).But is there a way to determine the playability of a file _without_ trying to play it?
Jeremiah Rose
2010-01-08 20:59:39
to answer my own question - you simply try to decode the file without connecting it to any physical output. in gstreamer, this means a filesrc, a decodebin and a fakesink
Jeremiah Rose
2010-05-18 23:55:20