Convert audio/video file to MP3
mouse 2194 · person cloud · link
Last update
2018-12-12
2018
12-12
«ffmpeg flac m4a mp3»

FFmpeg convert-all

Install ffmpeg:

1
2
3
4
5
6
# debian 8 jessie
apt-get install libav-tools
alias ffmpeg=avconv # put this in your ~/.bashrc

# debian 9 stretch
apt-get install ffmpeg

or just download a static build from the nice John Van Sickle (choose armhf-32bit for the raspberry pi).

Then use it to convert all your files:

1
2
3
for f in *.flac , *.m4a , *.ogg ; do
  ffmpeg -i "$f" -ab 320k "${f%.m4a}.mp3"
done

Note: In case of Too many packets buffered for output stream error use -max_muxing_queue_size option with a higher number (start at 1000).

FLAC to MP3 via custom encoder

1
flac -c -d in.flac | lame -m s -h -b 256 - out.mp3