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
ffmpeg -i input.flac -c:v copy -c:a alac output.m4a
-
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! `– ChrisCommented 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.– lloganCommented Jun 23, 2020 at 23:26
-
-
2
-
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!– ChrisCommented Jun 26, 2020 at 1:53
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
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.