Skip to content

Instantly share code, notes, and snippets.

@watr
Last active June 23, 2024 16:20
Show Gist options
  • Save watr/7860958a2a01a27e8e7a61a44b0341ce to your computer and use it in GitHub Desktop.
Save watr/7860958a2a01a27e8e7a61a44b0341ce to your computer and use it in GitHub Desktop.
find artwork image and add to '*.m4a' files
## this script depends on 'mp4art', one part of 'mp4v2'.
# brew install mp4v2
## if you need to remove artworks first,
# find . -type f -name '*.m4a' -print0 | xargs -0 mp4art --remove
## find local artwork image file and add to '*.m4a' files
artwork=`find . -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) -print | head -1`;
if [ -e "$artwork" ]; then find . -type f -name '*.m4a' -print0 | xargs -0 mp4art --add "$artwork" ; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment