0

I can convert a video to MP3 using FFmpeg with the following:

ffmpeg -i input -vol %volume% -y -acodec libmp3lame -ab %quality%k output

I have a static image file cover.jpg.

I want to use cover.jpg as album art with the converted audio which can be done by another command:

ffmpeg -i input.mp3 -i cover.jpg -map_metadata 0 -map 0 -map 1 output.mp3

But instead of using two commands, I need to use one command to convert the video to MP3 and embed the cover.jpg as album art.

How can I do this? Perhaps there is a way to do this by libmp3lame option?

I am lifting my hairs with this, please help.

Thank You.

Mahozad
  • 18,032
  • 13
  • 118
  • 133
  • I am still looking for a way to do this. It seems that I cant use lame options with libmp3lame (like --ti albumart.jpg) .. it returns an error. Some help please. – user3623407 May 18 '14 at 09:55
  • Does this answer your question? [How to add album art with ffmpeg?](https://stackoverflow.com/questions/18710992/how-to-add-album-art-with-ffmpeg) – Mahozad Sep 13 '22 at 17:00
  • [This new answer](https://stackoverflow.com/a/73706680/8583692) may be what you're looking for. – Mahozad Sep 13 '22 at 17:01

1 Answers1

0

(Moderator: please set this as a comment. I don't have the rep.)

What is the reason for needing it as a single command? Would putting those two commands into a batch script, using a temporary file, suffice?

Byron Katz
  • 492
  • 5
  • 10
  • Hello Byron, Thank you for replying. I am editing an existing script. This script sends the command only once, then process the output in other stages. I do not have the coding knowledge to modify the entire script. My only option is somehow do it in that single line. – user3623407 May 11 '14 at 07:18