Created
February 14, 2015 18:25
-
-
Save lobotony/0cb8453d2cdc6ce9633e to your computer and use it in GitHub Desktop.
Scrub metadata from m4a files by copying the AAC stream to a new file without reencoding, using ffmpeg. This script replaces the file you're scrubbing, so duplicate your data beforehand. I'm no shell expert and wanted something quick, so it's not very polished, e.g. it won't work with wildcards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INFILE="$@" | |
TEMPFILE=/tmp/$RANDOM | |
echo "processing file: " $INFILE | |
echo "extracting aac" | |
ffmpeg -i "$INFILE" -codec: copy $TEMPFILE.aac | |
echo "stuffing aac into m4a container" | |
ffmpeg -i $TEMPFILE.aac -bsf:a aac_adtstoasc -codec: copy $TEMPFILE.m4a | |
echo "replacing old with new" | |
rm "$INFILE" | |
mv $TEMPFILE.m4a "$INFILE" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very useful! Thank you for making this.