JuK Supports Opus Codec (sort of)

I just wanted to drop a quick note that JuK, the KDE music tagger/player component of the KDE Multimedia Software Compilation, now supports playback and limited metadata editing of Ogg Opus audio files.

This requires support from some underlying libraries:

  • The Taglib library must support Ogg Opus audio to add the track to your JuK collection at all. At this stage JuK can’t load a file to play if Taglib doesn’t support it, even if the playback system (Phonon) would otherwise support it. Taglib also provides the metadata reading/editing so our support is only as good as that provided by Taglib. For instance, the bitrates all show as 0kbps for my current encodes. Taglib only supports Opus in git as far as I can tell, so JuK uses configuration checks to see if Taglib supports Opus. JuK will still compile if Taglib doesn’t have Opus support.
  • To actually playback Opus audio, Phonon must support playback. Practically speaking this means your Phonon backend (VLC, or gstreamer, normally) must support Opus playback. Both underlying libraries already have releases (VLC 2.0.4 or later; gst-plugins-bad) supporting Opus so this shouldn’t be too hard.

One caveat is that I’m not sure what mimetype will eventually end up being used in shared-mime-data for Ogg Opus audio (probably audio/x-opus+ogg or audio/opus+ogg). At this point Ogg Opus audio gets detected as audio/ogg so I simply check for .opus extension if this fallback mimetype is identified.

In case it’s not clear from my writing “Ogg Opus” everywhere instead of just Opus, JuK currently does not support Opus audio in other container formats (such as Matroska). However the Opus standard recommends using Ogg as the container for purposes of storing audio as files so this should be how you encounter Opus files in practice.

2 thoughts on “JuK Supports Opus Codec (sort of)

  1. CTown Identicon CTown

    While, I’m glad to see that Juk is still getting updates, I’m still confused over Opus support in Juk. Isn’t Voribis the “open and rolyalty-free general purpose” audio codec, while Opus is meant for streaming live conversations (VoIP)? If Opus is also being used for music, what is the point of Vorbis, now? I’m just wondering since the same organization host both of these codecs.

    Reply
  2. mpyne Identicon mpyne Post author

    CTown: Vorbis is still supported, and you’re right that Opus was developed mostly in order to support low-latency operation (such as for real-time streaming). However the codec is not limited to real-time streaming (it has support for VoIP, “normal audio”, and one other mode I forget), and in fact is much improved compared to Vorbis even on functions Vorbis was specifically intended for. Additionally the audio can be streamed from storage on disk (e.g. recording a podcast for later streaming online) so there has to be a file format for Opus as well.

    That file format is Ogg (the combination is Ogg Opus) and since you may see it around I wanted to make sure JuK could play it and manage whatever metadata Taglib supports.

    Reply

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>