0

I'm currently trying to convert a Mp4 to a Mp3 using this answer with the following ffmpeg comand

ffmpeg -i video.mp4 -i cover.jpg -acodec libmp3lame -b:a 256k -c:v copy -map 0:a:0 -map 1:v:0 output.mp3

But when I try to run the command via terminal to stdout

ffmpeg -i video.mp4 -i cover.jpg -acodec libmp3lame -b:a 256k -c:v copy -map 0:a:0 -map 1:v:0 -f mp3 - > output.mp3

So I can avoid making files in between the next process, the resulting file does not have the thumb

0

Pictures require ID3v2 tags which FFmpeg writes at the start of the file, and after the audio payload has been muxed in. Since it can't seek in the pipe, ffmpeg can't do what you're asking for.

4
  • but ffmpeg can add in ID3v2 tags and even when I run the command with those it does not work when using pipe, I feel there must be a way with ffmpeg – nadermx May 29 '17 at 5:29
  • FFmpeg does not write 'attached pictures' at the beginning of the process, but waits. With a piped output, it can no longer seek to the beginning. – Gyan May 29 '17 at 5:32
  • I suppose you mean "Iffmpeg can't do what you're asking for"? – nadermx May 29 '17 at 5:35
  • Yes, corrected. – Gyan May 29 '17 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.