Skip to content

Instantly share code, notes, and snippets.

@cristianobecker
Last active January 14, 2016 16:00
Show Gist options
  • Save cristianobecker/54a8426b4130d0467898 to your computer and use it in GitHub Desktop.
Save cristianobecker/54a8426b4130d0467898 to your computer and use it in GitHub Desktop.
Convert a MKV file to MP4 with subtitles (xbox360 compatible) using ffmpeg
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
}
@cristianobecker
Copy link
Author

Sample:

convert-xbox Mad.Men.S07E08.Severance.720p.WEB-DL.DD5.1.h.264-NTb

@cristianobecker
Copy link
Author

To run videos in xbox360 from mac:

brew install minidlna
# follow instructions...

minidlnad -f ~/.config/minidlna/minidlna.conf   #start server
pkill minidlnad                                 #stop server

On the xbox360, test PC Connection to find the server

@jmurowaniecki
Copy link

Meu chapéu 🎩 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment