Ffmpeg: convert flac to mp3 and add album in one step

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 this in one step? Because I want to do this during live transcoding.

0
ffmpeg albumart
Jul 19 '14 at 13:05
source share
1 answer

You can use the channel instead of using a temporary file. You just need to explicitly specify the input / output format. Example:

 ffmpeg -i input.mp3 -f mp3 - | ffmpeg -f mp3 -i - -y output.mp3 

Your version will probably be:

 ffmpeg -i x.flac -f mp3 -vn -b:a 64K x.mp3 - | ffmpeg -f mp3 -i - -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 

That is, if you really can’t do

 ffmpeg -i x.flac -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)" -f mp3 -vn -b:a 64K xx.mp3 
  • -y by default ffmpeg overwrites the output file.
0
Jul 19 '14 at 13:17
source share



All Articles