Both available decoders for WMA, ffmpeg (the default) and avconv are not working. Here's the output from trying to decode an WMA file:
paulo@monk:~/tmp$ pacpl --verbose --to mp3 test.wma
Perl Audio Converter - 5.1.1
Converting: test.wma -> mp3
ffmpeg version 3.3.4-2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7 (Ubuntu 7.2.0-8ubuntu2)
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Output #0, asf, to '/home/paulo/tmp/test.wma':
Output file #0 does not contain any stream
decode failed with exit status: /home/paulo/tmp/test.wma: try with --verbose
Total files converted: 0, failed: 1
Decoding directly with ffmpeg works as expected:
paulo@monk:~/tmp$ ffmpeg -i test.wma test.wav
ffmpeg version 3.3.4-2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7 (Ubuntu 7.2.0-8ubuntu2)
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, asf, from 'test.wma':
Metadata:
WM/MediaPrimaryClassID: {D1607DBC-E323-4BE2-86A1-48A42A28441E}
WMFSDKVersion : 11.0.6000.6346
WMFSDKNeeded : 0.0.0.0000
WM/ProviderStyle: Choral
WM/EncodingTime : 18446744072369447296
publisher : Virgin Classics
genre : Classical
PeakValue : 31649
AverageLevel : 2427
track : 1
WM/Year : 2008
WM/UniqueFileIdentifier: AMGa_id=W 182910;
album : Bach: Cantatas, BWV 51, 82a, 199
album_artist : Natalie Dessay
WM/Provider : AMGClassical & Microsoft
IsVBR : 0
DeviceConformanceTemplate: L3
title : Cantata "Jauchzet Gott in allen Landen" BWV 51: I Aria: Jauchzet Gott in allen Landen
Duration: 00:03:58.76, start: 0.000000, bitrate: 193 kb/s
Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 192 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (wmav2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'test.wav':
Metadata:
WM/MediaPrimaryClassID: {D1607DBC-E323-4BE2-86A1-48A42A28441E}
WMFSDKVersion : 11.0.6000.6346
WMFSDKNeeded : 0.0.0.0000
WM/ProviderStyle: Choral
WM/EncodingTime : 18446744072369447296
publisher : Virgin Classics
IGNR : Classical
PeakValue : 31649
AverageLevel : 2427
IPRT : 1
WM/Year : 2008
WM/UniqueFileIdentifier: AMGa_id=W 182910;
IPRD : Bach: Cantatas, BWV 51, 82a, 199
album_artist : Natalie Dessay
WM/Provider : AMGClassical & Microsoft
IsVBR : 0
DeviceConformanceTemplate: L3
INAM : Cantata "Jauchzet Gott in allen Landen" BWV 51: I Aria: Jauchzet Gott in allen Landen
ISFT : Lavf57.71.100
Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
encoder : Lavc57.89.100 pcm_s16le
size= 41136kB time=00:03:58.74 bitrate=1411.5kbits/s speed= 831x
video:0kB audio:41136kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000598%
Forgot to add the test WMA file to the original post, here it goes.
I believe I found the bug, in this line:
It should be:
I've attached a patch, I hope I did it correctly.
Last edit: Paulo Marcel Coelho Aragão 2018-02-06
The file you submitted is an Microsoft ASF file, NOT a WMA audio file.
bash-4.4$ file test.wma
test.wma: Microsoft ASF
Once again, you didn't bother to look at the patch. Whether it's ASF or WMA, the fact is: your perl code isn't handling correctly the tags, and my patch fixes it. You can't just dismiss an issue like this. The code needs fixing, it's just a question of applying the patch. I shouldn't have bothered to submit a patch if I knew you wouldn't even look at it and consider it.
Philip,
ASF is the container, cf. https://en.wikipedia.org/wiki/Windows_Media_Audio#Container_format
For example:
% file taglib-1.11.1/tests/data/silence-1.wma
taglib-1.11.1/tests/data/silence-1.wma: Microsoft ASF
% mediainfo taglib-1.11.1/tests/data/silence-1.wma | grep Format
Format : Windows Media
Format : WMA
Format version : Version 2
I can reproduce the issue on this file (as well as on Paulo's test.wma), and the proposed fix works for me too. I'll be applying it in the Debian package.