Ffmpeg : convert FLAC to mp3 and add album art in one step

albumartffmpegtranscode

I convert FLAC to MP3 using

ffmpeg -i x.flac -f mp3 -vn -b:a 64K x.mp3

and I add album art using

ffmpeg -i x.mp3 -i x.jpg -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" xx.mp3

Is it possible to do it in one step? Because I want to do it during "live" transcoding.

Best Answer

As of ffmpeg 4.1.4 (I list the compilation flags below)

ffmpeg -i file.flac b:a 320k file.mp3

results in a high bitrate mp3 that keeps the original cover art and tags.

Some commenter argued VBR are transparent enough and save bitrate. Yes they are but I experienced seeking problems with them in some smartphone/hardware players.

built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version=1mx19+1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --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-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared

Related Topic