spotDL / spotify-downloader

Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
https://spotdl.readthedocs.io/en/latest/
MIT License
17.13k stars 1.57k forks source link

failed to convert, but have ffmpeg. Encoder not found. #2116

Closed 18aKissD closed 2 months ago

18aKissD commented 3 months ago

System OS

Linux

Python Version

3.7 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.2.5

Expected Behavior vs Actual Behavior

No response

Steps to reproduce - Ensure to include actual links!

image_2024-06-11_153133999 As it shows on the picture it downloads the track and then fails to convert it.

Ubuntu 22.04

Install: pip

I tried to download ffmpeg with spotdl, it succeeded and still fails.

Traceback

One example log here:
`### return_code:
8

### arguments:
['-nostdin', '-y', '-i', '/home/user/.spotdl/temp/RmCU1PHyMhQ.webm', '-movflags', '+faststart', '-v', 'debug', '-progress', '-', '-nostats', '-codec:a', 'libmp3lame', '-b:a', '124k', '/mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.mp3']

### ffmpeg:
ffmpeg

### version:
7.0

### build_year:
2024

### error:
ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: --disable-x86asm
libavutil      59.  8.100 / 59.  8.100
libavcodec     61.  3.100 / 61.  3.100
libavformat    61.  1.100 / 61.  1.100
libavdevice    61.  1.100 / 61.  1.100
libavfilter    10.  1.100 / 10.  1.100
libswscale      8.  1.100 /  8.  1.100
libswresample   5.  1.100 /  5.  1.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/user/.spotdl/temp/RmCU1PHyMhQ.webm'.
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' (alias for -c (select encoder/decoder)) with argument 'libmp3lame'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '124k'.
Reading option '/mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.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 @ 0x5d7be5dd08c0] 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/user/.spotdl/temp/RmCU1PHyMhQ.webm.
Successfully parsed a group of options.
Opening an input file: /home/user/.spotdl/temp/RmCU1PHyMhQ.webm.
[AVFormatContext @ 0x5d7be5dd9240] Opening '/home/user/.spotdl/temp/RmCU1PHyMhQ.webm' for reading
[file @ 0x5d7be5dd9a00] Setting default whitelist 'file,crypto,data'
[matroska,webm @ 0x5d7be5dd9240] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0x5d7be5dd9240] Before avformat_find_stream_info() pos: 600 bytes read:32768 seeks:0 nb_streams:1
Transform tree:
mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 120, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
fft4_ns_float_c - type: fft_float, len: 4, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf]
Transform tree:
mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 240, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
fft8_ns_float_c - type: fft_float, len: 8, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf]
Transform tree:
mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 480, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
fft16_ns_float_c - type: fft_float, len: 16, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf]
Transform tree:
mdct_pfa_15xM_inv_float_c - type: mdct_float, len: 960, factors[2]: [15, any], flags: [unaligned, out_of_place, inv_only]
fft32_ns_float_c - type: fft_float, len: 32, factor: 2, flags: [unaligned, inplace, out_of_place, preshuf]
[opus @ 0x5d7be5ddbc00] skip 312/960 samples
[matroska,webm @ 0x5d7be5dd9240] All info found
[matroska,webm @ 0x5d7be5dd9240] After avformat_find_stream_info() pos: 615 bytes read:32768 seeks:0 frames:1
Input #0, matroska,webm, from '/home/user/.spotdl/temp/RmCU1PHyMhQ.webm':
Metadata:
encoder         : google/video-file
Duration: 00:03:15.34, start: -0.007000, bitrate: 124 kb/s
Stream #0:0(eng), 1, 1/1000: Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default)
Successfully opened the file.
Parsing a group of options: output url /mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.mp3.
Applying option codec:a (alias for -c (select encoder/decoder)) with argument libmp3lame.
Applying option b:a (video bitrate (please use -b:v)) with argument 124k.
Successfully parsed a group of options.
Opening an output file: /mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.mp3.
[out#0/mp3 @ 0x5d7be5e1adc0] No explicit maps, mapping streams automatically...
[aost#0:0 @ 0x5d7be5e1a580] Unknown encoder 'libmp3lame'
[aost#0:0 @ 0x5d7be5e1a580] Error selecting an encoder
Error opening output file /mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.mp3.
Error opening output files: Encoder not found
[AVIOContext @ 0x5d7be5de1dc0] Statistics: 32768 bytes read, 0 seeks`

Other details

No response

BassHoven commented 3 months ago

[aost#0:0 @ 0x5d7be5e1a580] Error selecting an encoder

Error opening output file /mnt/win/Users/user/Music/spotdl/Infant Annihilator - Devotion to the Child Rape Syndicate.mp3.

Error opening output files: Encoder not found

Seems like it does not find the encoder Nah but really, i think you didn't download properly ffmpeg

18aKissD commented 3 months ago

Yes you were right.

For everyone coming with the same issue, the fix is installing ffmpeg from source manually. This is needed because Ubuntu messed up ffmpeg with libraries that are outdated and won't install properly (just like mp3Lame package). So

• Uninstall ffmpeg with sudo apt remove ffmpeg then sudo apt autoremove to remove the libraries that were downloaded but is not needed now as you removed ffmpeg. • Install dependencies from here. • Always go with building and do not go with the apt installs, this is the most important part. !Read the site carefully because there are way so many codecs I don't know which ones do you want!.

There might be some installs that take some time but be patient please.

Hope this helps someone :)

BassHoven commented 3 months ago

probably want to close this issue