Poll

Do you think support for webm (a container for Vorbis and Opus files) should be added to MusicBee?

Yes, high priority!
Yes
I am not sure
I don't care about webm, the open-source and royalty free container supported by many other players...

Author Topic: Support for webm/opus!  (Read 2322 times)

illtellyoulater

  • Newbie
  • *
  • Posts: 5
Hi everyone, this is my first post here, I'm glad to have found this nicely engineered piece of software that MusicBee is and I hope I'll be enjoying your company too :)

I would like to ask you all, and to the devs specifically, how is that that support for webm container (and the codec generally used with it, Opus) is not there yet?

Both the codec(s) in webm (Vorbis, Opus) and webm itself, are opensource and royalty free and Opus is probably the best audio codec currently, so why not make them first class citizens in MusicBee?

Are there any plans to implement it?

Searching this forum I could only find a couple of old threads where this was only superficially touched...

So don't leave me alone now, anyone interested please have your say and let's make this thread take off for good!

Thank you!
Last Edit: September 19, 2017, 06:53:02 AM by illtellyoulater

theta_wave

  • Hero Member
  • *****
  • Posts: 656
Opus should be supported (the latest version of Musicbee has BASS' opus library (bassopus.dll) among the other library files in its main program directory.  WEBM is a container format usually for video and audio, no?  You should strip out the audio stream (see HowTo below).

If you want to strip out the opus audio stream from WEBM's, you'll need ffmpeg (https://ffmpeg.zeranoe.com/builds/)


HowTo: https://superuser.com/questions/412890/lossless-extraction-of-streams-from-webm

Code
ffmpeg -i "input.webm" -vn -acodec copy "output.opus"

That is unless Steven comes up with something else.

illtellyoulater

  • Newbie
  • *
  • Posts: 5
Opus should be supported (the latest version of Musicbee has BASS' opus library (bassopus.dll) among the other library files in its main program directory.  WEBM is a container format usually for video and audio, no?  You should strip out the audio stream (see HowTo below).

Thanks! And that's what I also knew from searching the forum (in a thread it is said "opus should already be supported") but then for some reason I must have tried with a corrupted opus file and convinced myself that it was not fully supported or something like that!  :-\  :-[

Thanks for reassuring me, now I'm happily playing opus files :)

Yea the ffmpeg command was useful, although I actually needed the conversion for audio streams downloaded from youtube and I found that youtube-dl (other than downloading) does this extraction step on its own in just one command line with the "--extract-audio" parameter (and it uses ffmpeg for that internally).

illtellyoulater

  • Newbie
  • *
  • Posts: 5

That is unless Steven comes up with something else.



Going back to this... now I am facing the situation where MusicBee reads .opus files but doesn't read .webm containers containing Opus audio, while a popular DJing app I am using only reads opus audio when it's contained in a webm container.

So this forces me having 2 different versions of the same file, doubling up my audio storage requirements.

The only thing I could do is re-encode the Opus file to another format, but I am sure that you are aware of the quality loss and artifacts that re-encoding introduces, which I obviously would like to avoid.

Maybe I would not care too much if the audio material I was starting with was lossless or very high quality lossy, but this is usually not the case for many people, for example I am also working with files downloaded off youtube, which are encoded only at a "just decent" quality, and have been sometimes encoded multiple times, by people downloading them and re-uploading to youtube.

This could all be avoided if MusicBee supported the webm container, which I think is fully expected for an audio player in 2017! As I said, it's an open-source, royalty free format, so why not include in MusicBee. As a side effect, it could only attract more users!

Dev, what do you think about this?

Users, please support this request by casting your vote in the poll!
Last Edit: September 19, 2017, 07:08:05 AM by illtellyoulater

illtellyoulater

  • Newbie
  • *
  • Posts: 5
This

So this forces me having 2 different versions of the same file, doubling up my audio storage requirements.

The only thing I could do is re-encode the Opus file to another format, but I am sure that you are aware of the quality loss and artifacts that re-encoding introduces, which I obviously would like to avoid.



Correcting myself, I found a solution.

Because .ogg is supported by MusicBee, and ogg is a container, and ogg can also contain Opus audio streams (other than Vorbis), then with the help of ffmpeg it is possible to simply copy the Opus audio stream from the webm container to the ogg container, with no trascoding and consequently no audio quality loss. Ogg files can be read by almost any audio app today (including the DJing app I was talking about).


The command for doing that is:

Code
ffmpeg -i "file.webm" -c:a copy "file.ogg"

It can also operate directly on opus files:

Code
ffmpeg -i "file.opus" -c:a copy "file.ogg"
and of course in this case too there won't be any transcoding. It's just the opus audio stream being copied inside the ogg container.

Bonus: put this in a Windows batch file and it will do the operations above for all the webm and opus files in the folder where it is ran:

Code
for %%a in ("*.webm") do ffmpeg -i "%%a" -c:a copy "%%~na.ogg"
for %%a in ("*.opus") do ffmpeg -i "%%a" -c:a copy "%%~na.ogg"


Anyway, support for .webm would still be a nice thing to have :)


P.S. I researched this whole topic in the last week myself starting from zero knowledge about codecs and containers so I'd appreciate a lot if someone could confirm this is all correct!! Thanks!
Last Edit: September 19, 2017, 03:51:45 PM by illtellyoulater

sveakul

  • Hero Member
  • *****
  • Posts: 919
It looks like there is hope on the horizon for this, as I just discovered that the BASS developer at un4seen has posted an experimental plugin that will allow the BASS libraries MusicBee uses to work with webm, basswebm.dll.  FYI you can download it here:  http://www.un4seen.com/stuff/basswebm.zip.  But it's not just a matter of dropping it into MusicBee for it to work, the program also needs to add code to load it.  I think Steven usually waits until these things reach an actual release status before putting them into MB.

illtellyoulater

  • Newbie
  • *
  • Posts: 5
Cool, good to know, thanks for letting me know!  :-X
I hope it will be added soon in a release version...
Cheers!