Last active
January 14, 2016 16:00
-
-
Save cristianobecker/54a8426b4130d0467898 to your computer and use it in GitHub Desktop.
Convert a MKV file to MP4 with subtitles (xbox360 compatible) using ffmpeg
This file contains 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
xbox-convert() { | |
if test $# -eq 1; then | |
local extension=$(echo "$1" | egrep -o '\.[^\.]+$') | |
local file=$(echo "$1" | sed -e "s/"$extension"$//") | |
if test -f "$file.srt" && test -f "$1"; then | |
ffmpeg -sub_charenc "ISO-8859-1" -i "$file.srt" "$file.ass" | |
ffmpeg -i "$1" -vf ass="$file.ass" -vcodec libx264 -acodec ac3 -ab 160k "$file.mp4" | |
rm "$file.ass" | |
else | |
echo ".str file and video file should have the same name" | |
fi | |
else | |
echo "please, inform the video file" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Meu chapéu 🎩 !