Question

I'm using Rockbox on my iPod Classic. It supports showing embedded album art from MP3 files, but only if those images have the JPG extension.

Some of my embedded images have the PNG extension. The accompanying songs show up without the corresponding album art.

I'm looking for a script that will change these embedded images to the JPG format, so they will be showed correctly.

This doesn't have to be a bash script - any programming language will do.

No correct solution

OTHER TIPS

ffmpeg should be able to do this, e.g.

ffmpeg -i song_with_png.mp3 -acodec copy -vcodec mjpeg song_with_mjpeg.mp3

A bash script could then be

DESTINATION="dest"
mkdir -p ${DESTINATION}
shopt -s nullglob
for i in *.mp3 *.MP3;
do 
  name=`echo ${i} | cut -d'.' -f1`;
  echo ${name};
  ffmpeg -i "${i}" -acodec copy -vcodec mjpeg "${DESTINATION}/${name}.mp3";
done

I used the script to convert my aac encoded files playing in my cars audio system, leaving out the "-acodec copy" option so the audio gets converted as well, not only copied.

ffmpeg output should the contain something like this at the end:

...
Stream mapping:
  Stream #0:1 -> #0:0 (png (native) -> mjpeg (native))
  Stream #0:0 -> #0:1 (copy)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top