问题
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.
回答1:
You can use a pipe instead of using a temporary file. You just have to explicitly specify the format of input/output. Example:
ffmpeg -i input.mp3 -f mp3 - | ffmpeg -f mp3 -i - -y output.mp3
Probably your version would 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
makesffmpeg
overwrite output file by default.
来源:https://stackoverflow.com/questions/24840708/ffmpeg-convert-flac-to-mp3-and-add-album-art-in-one-step