spotify-downloader: FFmpegError: Failed to convert

System OS

Other

Python Version

3.10 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.2.11

Expected Behavior vs Actual Behavior

Hi! I’m suddenly getting the error below, up till now it’s been working perfectly:

I’m running in Windows WSL. I’ve been sure to run update and upgrade too.

FFmpegError: Failed to convert

Here is the detailed error log:

Steps to reproduce - Ensure to include actual links!

spotdl https://open.spotify.com/playlist/locationEtcAndStuffa;ldfja;lkjfasljfa;sdlkdas;lkjas;fjasg

Traceback

### return_code:
1

### arguments:
['-nostdin', '-y', '-i', '/home/greg/.spotdl/temp/PHcq_Pfrsas.mp4', '-movflags', '+faststart', '-v', 'debug', '-progress', '-', '-nostats', '-codec:a', 'libmp3lame', '-b:a', 'copy', '/home/greg/music/OldSchoolClubhouse/Starship - We Built This City.mp3']

### ffmpeg:
ffmpeg

### version:
4.4

### build_year:
2021

### error:
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
Splitting the commandline.
Reading option '-nostdin' ... matched as option 'stdin' (enable or disable interaction on standard input) with argument 0.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input url with argument '/home/greg/.spotdl/temp/PHcq_Pfrsas.mp4'.
Reading option '-movflags' ... matched as AVOption 'movflags' with argument '+faststart'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-progress' ... matched as option 'progress' (write program-readable progress information) with argument '-'.
Reading option '-nostats' ... matched as option 'stats' (print progress report during encoding) with argument 0.
Reading option '-codec:a' ... matched as option 'codec' (codec name) with argument 'libmp3lame'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument 'copy'.
Reading option '/home/greg/music/OldSchoolClubhouse/Starship - We Built This City.mp3' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option nostdin (enable or disable interaction on standard input) with argument 0.
Applying option y (overwrite output files) with argument 1.
Applying option v (set logging level) with argument debug.
Applying option progress (write program-readable progress information) with argument -.
[pipe @ 0x5582f23fa100] Setting default whitelist 'crypto,data'
Applying option nostats (print progress report during encoding) with argument 0.
Successfully parsed a group of options.
Parsing a group of options: input url /home/greg/.spotdl/temp/PHcq_Pfrsas.mp4.
Successfully parsed a group of options.
Opening an input file: /home/greg/.spotdl/temp/PHcq_Pfrsas.mp4.
[NULL @ 0x5582f2402680] Opening '/home/greg/.spotdl/temp/PHcq_Pfrsas.mp4' for reading
[file @ 0x5582f2403240] Setting default whitelist 'file,crypto,data'
[aac @ 0x5582f2402680] Format aac probed with size=2048 and score=51
id3v2 ver:3 flags:00 len:63
[aac @ 0x5582f2402680] Before avformat_find_stream_info() pos: 73 bytes read:65696 seeks:4 nb_streams:1
[aac @ 0x5582f2402680] All info found
[aac @ 0x5582f2402680] Estimating duration from bitrate, this may be inaccurate
[aac @ 0x5582f2402680] After avformat_find_stream_info() pos: 19565 bytes read:65696 seeks:4 frames:50
Input #0, aac, from '/home/greg/.spotdl/temp/PHcq_Pfrsas.mp4':
Metadata:
id3v2_priv.com.apple.streaming.transportStreamTimestamp: \x00\x00\x00\x00\x00\x00\x03\x92
Duration: 00:04:47.73, bitrate: 134 kb/s
Stream #0:0, 50, 1/28224000: Audio: aac (LC), 44100 Hz, stereo, fltp, 134 kb/s
Successfully opened the file.
Parsing a group of options: output url /home/greg/music/OldSchoolClubhouse/Starship - We Built This City.mp3.
Applying option codec:a (codec name) with argument libmp3lame.
Applying option b:a (video bitrate (please use -b:v)) with argument copy.
Successfully parsed a group of options.
Opening an output file: /home/greg/music/OldSchoolClubhouse/Starship - We Built This City.mp3.
[file @ 0x5582f243fb00] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
detected 20 logical cores
[graph_0_in_0_0 @ 0x5582f2434640] Setting 'time_base' to value '1/44100'
[graph_0_in_0_0 @ 0x5582f2434640] Setting 'sample_rate' to value '44100'
[graph_0_in_0_0 @ 0x5582f2434640] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_0 @ 0x5582f2434640] Setting 'channel_layout' to value '0x3'
[graph_0_in_0_0 @ 0x5582f2434640] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3
[format_out_0_0 @ 0x5582f2430740] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[format_out_0_0 @ 0x5582f2430740] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[format_out_0_0 @ 0x5582f2430740] Setting 'channel_layouts' to value '0x4|0x3'
[AVFilterGraph @ 0x5582f24325c0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[libmp3lame @ 0x5582f2414f00] [Eval @ 0x7ffe80d76cf0] Undefined constant or missing '(' in 'copy'
[libmp3lame @ 0x5582f2414f00] Unable to parse option value "copy"
[libmp3lame @ 0x5582f2414f00] Error setting option b to value copy.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 0x5582f2404a40] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x5582f240b640] Statistics: 65696 bytes read, 4 seeks
Conversion failed!

Other details

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 10
  • Comments: 28

Most upvoted comments

I got the same issue like 30 minutes agos πŸ˜…

I just change the bitrate in the config file (C:\Users\YOURUSER\.spotdl\config.json)

Switch from null to β€œ128k”

"bitrate": "128k",

It should do the trick ! πŸ‘

For any Linux users who are having this error and finding this issue, the config file is in ~/.spotdl/config.json (or /home/(your username)/.spotdl/config.json in the absolute path.)

I got the same issue like 30 minutes agos πŸ˜…

I just change the bitrate in the config file (C:\Users\YOURUSER.spotdl\config.json)

Switch from null to β€œ128k”

"bitrate": "128k",

It should do the trick ! πŸ‘

it works! thanks alot

@sachalethug thank you!! It works again! Not sure why it suddenly stopped working in the first, but there it is. 😁

Is there a workaround which permits a higher bitrate?

You can set the option to any of these settings as shown in the spotdl command arguments and it should fix the issue: {auto,disable,8k,16k,24k,32k,40k,48k,64k,80k,96k,112k,128k,160k,192k,224k,256k,320k,0,1,2,3,4,5,6,7,8,9}

I put mine at 320k and it seems to download everything fine.