Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ $# != 1 ]
- then
- echo 'syntax)' `basename $0` '<movie>'
- exit
- fi
- target=$1
- base=`echo $target | sed -e 's@\.[a-z0-9]*$@@g'`
- fmt=`ffprobe -i "$target" 2>&1| grep Audio: | sed -e 's@.*Audio: \([a-z0-9]*\),.*@\1@g'`
- ffmpeg -acodec copy -i "$target" "$target.$fmt"
- cname="$target.$fmt"
- if [ "$fmt" == "aac" ]
- then
- MP4Box -add "$cname" "$target.m4a"
- rm "$cname"
- cname="$target.m4a"
- fmt="m4a"
- fi
- mv "$cname" "$base.$fmt"
Add Comment
Please, Sign In to add comment