Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foobar won't play any Opus files (Read 8383 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar won't play any Opus files

Hi,

I have foobar2000 1.3.9, and for some reason I'm not able to play Opus files.
They show in my playlist viewer with no information at all, even in the Properties window (second tab "Properties").

Here's some Mediainfo on one of the Opus files I can't play :

Code: [Select]
General
Complete name               : D:\Downloads\Test.opus
Format                      : WebM
Format version              : Version 4 / Version 2
File size                   : 4.25 MiB
Duration                    : 4mn 23s
Overall bit rate            : 135 Kbps
Writing application         : google
Writing library             : google

Audio
ID                          : 1
Format                      : Opus
Codec ID                    : A_OPUS
Duration                    : 4mn 23s
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 KHz
Compression mode            : Lossy
Language                    : English
Default                     : Yes
Forced                      : No

Here's what foobar2000's Console says :
Code: [Select]
could not enumerate tracks (Unsupported format or corrupted file) on: D:\Downloads\Test.opus
Opening track for playback: "D:\Downloads\Test.opus"
Unable to open item for playback (Unsupported format or corrupted file): "D:\Downloads\Test.opus"
Wave cache: generic IO exception (Unsupported format or corrupted file) for "D:\Downloads\Test.opus"

I thought foobar2000 supported Opus since version 1.1.4, and I have version 1.3.9.
What am I doing wrong ? Do I need to install a specific component to support Opus ?
Thanks.

 

Re: foobar won't play any Opus files

Reply #1
MediaInfo indicates that this file has an Opus stream inside WebM container (subset of Matroska). You might be able to play the file after it is renamed with the correct .webm or .mka extension.

Re: foobar won't play any Opus files

Reply #2
Thanks j7n for the tip.
Couldn't I simply remove/replace the WebM container (without reencoding of course) and get a "real" opus file instead ?
And in that case, what would be the easiest tool for doing so ?
For the record, Audacity opens the file without any problems. Maybe foobar could do the same instead of just claiming that it's an "unsupported format or corrupted file". Just sayin'. ;)

Re: foobar won't play any Opus files

Reply #3
FFMPEG can extract the opus stream.

Code: [Select]
ffmpeg -i test.mkv -acodec copy test.opus

I would suggest a GUI tool, but all MKV extractors I have are fairly old, from before Opus packing was standardized in Matroska. If I needed to use the above command often on one or a few files at a time, I'd add it as as file association in Windows.

Most software usually detect the file type from the file header. Foobar isn't among them. Maybe there is too much guesswork involved with MPEG files that often have large tags prepended.

Re: foobar won't play any Opus files

Reply #4
ffmpeg is fine. Thanks.  :D
I have tried to automate the task :
Code: [Select]
ren *.opus *.mka
FOR %F IN (*.mka) DO "C:\Program Files\FFmpeg\bin\ffmpeg.exe" -i "%F" -acodec copy "%F.opus"
del *.mka

Funny thing is, if I open a CMD within the folder with the .opus files (Context menu > "Open CMD") and I manually type these three exact commands, everything works fine. But if I make a .bat to execute these three exact commands automatically, it doesn't work. Only the first command is executed. Any hints ?

Re: foobar won't play any Opus files

Reply #5
try this for your batch.

Code: [Select]
ren *.opus *.mka
FOR %%F IN (*.mka) DO "C:\Program Files\FFmpeg\bin\ffmpeg.exe" -i "%%F" -acodec copy "%%F.opus"
del *.mka
Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith.

Re: foobar won't play any Opus files

Reply #6
It worked ! Genius ! :D

Thanks to you both. Problem solved I guess.

Re: foobar won't play any Opus files

Reply #7
Ninja'd. To see what the batch line actually expands into and any error messages, I opened a command prompt and typed the name of the batch file in it.

I found a way how to get rid of the double extension in output files.

Code: [Select]
ren *.opus *.mka
FOR %%F IN (*.mka) DO "C:\Program Files\FFmpeg\bin\ffmpeg.exe" -i "%%F" -acodec copy "%%~nF.opus"
del *.mka

Re: foobar won't play any Opus files

Reply #8
Actually I'm keeping the double extension : it helps me differentiate the treated opus files from the untreated ones. ;)

Re: foobar won't play any Opus files

Reply #9
MediaInfo indicates that this file has an Opus stream inside WebM container (subset of Matroska). You might be able to play the file after it is renamed with the correct .webm or .mka extension.
Thanks it helped. :)  :)  :)