How can I convert a WMA file to an MP3

When I try ffmpeg, I get This build of ffmpeg does not include a "wmav2" decoder needed for input stream #0:0.

Enable RPMFusion repositories:

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Then swap ffmpeg-free from Fedora repos with ffmpeg from RPMFusion:

sudo dnf --allowerasing swap ffmpeg-free ffmpeg
2 Likes

I did what you suggested successfully. Now I get:

# ffmpeg -i '01 Vivo Sonhando (Dreamer).wma' -acodec libmp3lame -ab 192k '01 Vivo Sonhando (Dreamer).mp3'
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[asf @ 0x5600a0183e80] DRM protected stream detected, decoding will likely fail!
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, asf, from '01 Vivo Sonhando (Dreamer).wma':
  Metadata:
    title           : 01 Vivo Sonhando (Dreamer)
    artist          : João Gilberto; Stan Getz
    WMFSDKVersion   : 8.00.00.4487
    WMFSDKNeeded    : 0.0.0.0000
    WM/Year         : 2003
    WM/UniqueFileIdentifier: AMGa_id=R   625484;AMGp_id=VA;AMGt_id=T  6032962
    composer        : Antonio Carlos Jobim
    publisher       : Verve
    genre           : Jazz
    album           : Bossa Nova for Lovers
    album_artist    : Various Artists
    WM/Provider     : AMG
    WM/ProviderRating: 7
    WM/ProviderStyle: Jazz
    track           : 1
    WM/EncodingTime : 18446744072150863232
    ASF_Protection_Type: DRM
    ASF_Key_ID      : 2w0/X99bjljyjt/fhL7bWTmY
    ASF_License_URL : http://go.microsoft.com/fwlink/?prd=816&pver=7.1&sbp=DRM&plcid=0x409&clcid=0x409&ar=PersonalV2
  Duration: 00:02:55.96, start: 0.000000, bitrate: 64 kb/s
  Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (wmav2 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
    Last message repeated 1 times
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is 0 bits left 23776
    Last message repeated 1 times
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is -1 bits left 23776
Error while decoding stream #0:0: Invalid data found when processing input
[wmav2 @ 0x5600a018a600] prev_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is 0 bits left 23776
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is 0 bits left 23776
[wmav2 @ 0x5600a018a600] block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] overflow (118 > 116) in spectral RLE, ignoring
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[...]
[wmav2 @ 0x5600a018a600] next_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] frame_len overflow
Error while decoding stream #0:0: Operation not permitted
Output #0, mp3, to '01 Vivo Sonhando (Dreamer).mp3':
  Metadata:
    TIT2            : 01 Vivo Sonhando (Dreamer)
    TPE1            : João Gilberto; Stan Getz
    WMFSDKVersion   : 8.00.00.4487
    WMFSDKNeeded    : 0.0.0.0000
    WM/Year         : 2003
    WM/UniqueFileIdentifier: AMGa_id=R   625484;AMGp_id=VA;AMGt_id=T  6032962
    TCOM            : Antonio Carlos Jobim
    TPUB            : Verve
    TCON            : Jazz
    TALB            : Bossa Nova for Lovers
    TPE2            : Various Artists
    WM/Provider     : AMG
    WM/ProviderRating: 7
    WM/ProviderStyle: Jazz
    TRCK            : 1
    WM/EncodingTime : 18446744072150863232
    ASF_Protection_Type: DRM
    ASF_Key_ID      : 2w0/X99bjljyjt/fhL7bWTmY
    ASF_License_URL : http://go.microsoft.com/fwlink/?prd=816&pver=7.1&sbp=DRM&plcid=0x409&clcid=0x409&ar=PersonalV2
    TSSE            : Lavf59.27.100
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc59.37.100 libmp3lame
[wmav2 @ 0x5600a018a600] frame_len overflowA speed=   0x    
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is -1 bits left 23776
Error while decoding stream #0:0: Invalid data found when processing input
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] nb_frames is -1 bits left 23776
Error while decoding stream #0:0: Invalid data found when processing input
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 4 out of range
Error while decoding stream #0:0: Operation not permitted
[...]
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] next_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 6 out of range
Error while decoding stream #0:0: Operation not permitted
[wmav2 @ 0x5600a018a600] prev_block_len_bits 5 out of range
Error while decoding stream #0:0: Operation not permitted
size=       4kB time=00:02:55.64 bitrate=   0.2kbits/s speed=2.28e+04x    
video:0kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 44.926613%
Conversion failed!
# 

Any ideas?

Thanks!

Near the very beginning of that it says that DRM is a problem and it may fail.
It also has lots of messages about ‘Operation not permitted’

I don’t know exactly what the issue is, but from those messages I would suspect that this is DRM restrictions that are interfering.

What media is the wma file from? If it is CD then it may be possible to use a tool such as k3b, brasero, or handbrake to rip the track from the CD, instead of copying the file to a hard drive and trying to convert it there.

I seem to recall that the file format on a CD can be either wma or wav but can easily be converted to wav, ogg, or mp3 by ripping with an appropriate tool.

1 Like

Yes. Riping would be easy. The problem is that this file is just one of thousands. Re-riping is unreasonable. Not sure what to do.

You can probably convert them using a free-as-in-coffee utility called MakeMKV that can handle drm. It’s proprietary but there’s a gratis license for Linux users:

1 Like

Lets say there is a certain percentage of the ones you have that are DRM protected but you do not know how many.

It would not be difficult to write a script that would read the file names and attempt the conversion, saving the output mp3 file in a different directory. If successful then the original could be moved to a different directory so it can easily be identified as already converted.

If the conversion fails then that source file can be left as is or moved to another directory so it is also easy to identify those that failed.

Once the first run is done that either works or fails and the failures are separated out then you would have a smaller (hopefully) list to work from with the DRM issue. Depending upon how many may be involved then a plan to continue could be created.

While I concur that ripping for a second time would be time consuming, DRM is what it is. Making copies with that tech is sometimes difficult. Just copying the file is usually easy. Converting it is not so easy at times.

1 Like

There’s also the reality that wma and mp3 are lossy types so apart from DRM, you’d also be taking a quality hit by converting rather than ripping. Kind of like if you’ve ever dubbed from a dubbed casette or VHS tape, each “generation” loses some quality.

I suggest ripping instead to FLAC, which is lossless, and then converting to mp3, ogg, wma, etc from there.

Not sure if this will work
You could try fre:ac
It’s a flatpak