Enumerate supported multimedia formats/codecs

I’m trying to stream videos from a Jellyfin server using QtMultimedia. Is there a nice way to list supported container formats with their supported codecs? Somewhere in the process of obtaining a video stream, the server wants to know a list of supported media codecs and streaming formats, so it knows when it needs to transcode and when it can avoid it.

I could hardcode them, but I’d rather discover them in some sort of way. Who knows if SailfishOS is going to blow up and support a very wide range of devices :slight_smile: . I can’t test all the configuration on all Sailfish OS devices that are available right now.

I don’t want to maintain a huge list of tests with hardcoded exceptions either if there is an other way. That would cost a lot of time.

I’ve looked into using QMediaPlayer::hasSupport(), but that only checks if the given format is supported, it doesn’t enumerate anything. So I’d have to manually compile a list with known mime types and codecs.

I heard QtMultimedia uses gstreamer as its backend, but since linking to gstreamer is not allowed in the Harbour, it’s not really an option. I’m not even sure if gstreamer is able to enumerate its supported codecs, but I thought I’d list it here for completeness sake.

Does someone know of a better way? Please let me know

1 Like

The old gstreamer problem since Rokua… Would be very nice to see support for more Codecs soon. Still angry that I lost Alac with Rokua Update, but need that cause of Rokuas native Nextcloud support…

Well, my current solution is to hardcode a few common codecs and containers, and testing them with QMediaPlayer::hasSupport(), while explicity whitelisting a few as a fallback that I’ve manually tested (like mp3, apparently QMediaPlayer::hasSupport() returns “maybe”). I guess my Jellyfin player will have to rely on this and bug reports.

I always thought that the files at /opt/alien/etc/media_*.xml store the list of supported hardware codecs…
No idea which one is the correct one, but it at least looks like that list you are looking for.