I'm trying to convert m4a audio file with artwork (cover) to mp3. I'm using ffmpeg to convert the audio.
Once it copies, the artwork is lost. I'm quite not sure, how to retain the cover. I found some reference about mutagen library but not sure again how to use to copy the artwork.
Any help would be great.
ffmpeg -i source/file -acodec libmp3lame -ab 128k destination.mp3
Update:
I'm reading the artwork and m4a to be able to attache it back. I can get the artwork by using
artwork = audio.tags['covr']
Now my problem is how do I save the artwork as image in a new file?
I tried the Following:
with open(path/to/write, 'wb') as img:
img.write(artwork)
This gives me an error
'list' does not support the buffer interface line
Any suggestion, how I can save the artwork extracted covr data?
I can't test it right now, but map_metadata should help if the album cover is part of the metadata.