Skip to content

Instantly share code, notes, and snippets.

@mkayala
Created February 3, 2013 21:49
Show Gist options
  • Save mkayala/4703819 to your computer and use it in GitHub Desktop.
Save mkayala/4703819 to your computer and use it in GitHub Desktop.
Script to convert video to mp4 in a way that is playable on the Kindle Fire. Prereqs: Compile the latest ffmpeg and x264 encoder. On Ubuntu, this worked well: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
#!/bin/bash
## Convert input files $name.* into $name.mp4, suitable for playing
## in Kindle Fire.
usage="$0 file1 [file2 ...]"
if [ -z "$1" ]
then
echo $usage
exit 1
fi
audio="libmp3lame"
for ifile in "$@"
do
ofile="${ifile/.*/.mp4}"
echo "Convert from $ifile to $ofile"
echo ffmpeg -i $ifile -acodec $audio -ab 96k -vcodec libx264 -f mp4 $ofile
ffmpeg -i $ifile -acodec $audio -ab 96k -vcodec libx264 -f mp4 $ofile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment