Created
March 7, 2014 15:23
-
-
Save ahknight/9413442 to your computer and use it in GitHub Desktop.
Convert pretty much any video file to a format that will play on an AppleTV 3 (and maybe a 2). Only converts streams that need it.
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/bash | |
FILE="$1" | |
VCODEC=$( mediainfo --Inform="Video;%Format%" "$FILE" ) | |
ACODEC=$( mediainfo --Inform="Audio;%Format%" "$FILE" ) | |
echo $FILE: $VCODEC/$ACODEC | |
[ "$VCODEC" = "AVC" ] && VC="copy" || VC="libx264" | |
[ "$ACODEC" = "AAC" ] && AC="copy" || AC="aac -strict experimental" | |
avconv -i "$FILE" -vcodec $VC -acodec $AC "${FILE/%.???/.mp4}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment