Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Created May 19, 2013 22:58
Show Gist options
  • Select an option

  • Save igrigorik/5609408 to your computer and use it in GitHub Desktop.

Select an option

Save igrigorik/5609408 to your computer and use it in GitHub Desktop.
Convert video to iPod friendly format, and speed up playback.
#! /bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
outformat=mp4
indir=$1
cd "$indir"
for file in *
do
echo "\n\nStarting conversion: $file \n"
/git/ffmpeg/build/bin/ffmpeg -i "$file" \
-f $outformat \
-filter_complex '[0:v]setpts=0.588*PTS,scale=640:-1[v];[0:a]atempo=1.70[a]' \
-map '[v]' -map '[a]' \
-vb 533K \
-vcodec libx264 \
-vprofile baseline \
-maxrate 10000000 \
-bufsize 10000000 \
-threads 0 \
-strict -2 processed-"$file".$outformat
done
echo ALL Processed!
IFS=$SAVEIFS
$> git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
$> ./configure --prefix=/git/ffmpeg/build --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bin/clang --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libvpx --enable-libxvid --enable-filters --enable-avfilter --arch=x86_64 --enable-runtime-cpudetect
$> make && make build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment