2

I have seen a few discussions on this but none of them give the answer I was hoping for. I am trying to convert flac to alac while preserving all of the tags and the embedded cover image. I know we can manually set a cover image by passing a separate image file to ffmpeg.... but how do I use the one embedded in the flac file? dbpoweramp does this automatically, but I would rather use ffmpeg so that I can automate my workflow with a bash script.

3 Answers 3

4
ffmpeg -i input.flac -c:v copy -c:a alac output.m4a
6
  • Thanks for the reply but that doesn't work for me ` [ipod @ 0x55a0bbcecde0] Could not find tag for codec mjpeg in stream #0, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:1 -- Conversion failed! `
    – Chris
    Commented Jun 23, 2020 at 21:10
  • @Chris I'll need to see your command and the complete console output. You can use a pastebin site and provide a link in a comment.
    – llogan
    Commented Jun 23, 2020 at 23:26
  • Thats a good idea. Here is the link pastebin.com/x41mvWee
    – Chris
    Commented Jun 25, 2020 at 1:35
  • 2
    @Chris Your ffmpeg is too old. Download a new one here. Put it in /usr/local/bin (or ~/bin but you'll have to log out/log in or run source ~/.profile for it to get recognized in ~/bin).
    – llogan
    Commented Jun 25, 2020 at 18:05
  • I cant believe it was that simple. I would have thought the Ubuntu version would have been kept up to date. Never thought to even check. Lesson learned, thanks!
    – Chris
    Commented Jun 26, 2020 at 1:53
2

Fixed by adding a source that has a newer version... sudo add-apt-repository ppa:jonathonf/ffmpeg-4 ...And using @logan command... ffmpeg -i input.flac -c:v copy -c:a alac output.m4a

Thanks

1

I was unable to get the jonathon ppa to work on my rig so you can use "-vcodec copy " "$FILE" -vcodec copy -acodec alac "$NEW_FILE" to copy the image over to the new file.

However, I do see that file names with "()" sometimes don't convert. I don't get an error in my script it just moves on. without the copy. Would be nice if anyone know how to fix that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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