Skip to content

Instantly share code, notes, and snippets.

@oc
Created April 29, 2011 21:29
Show Gist options
  • Select an option

  • Save oc/949076 to your computer and use it in GitHub Desktop.

Select an option

Save oc/949076 to your computer and use it in GitHub Desktop.
Source this
FFMPEG=/opt/ffmpeg/bin/ffmpeg
function avi2ipad() {
for file in $*; do
title=$(basename ${file} .avi)
outfile=${title}.mp4
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
if [[ -f ${file} ]]; then
echo "[${timestamp}] Converting ${file} to ${outfile}"
time ${FFMPEG} -y -i ${file} -f mp4 -metadata title=${title} \
-timestamp ${timestamp} -vcodec libxvid -s 480x270 -b 1024k \
-bufsize 2M -maxrate 1.5M -g 250 -flags +aic+cbp+mv0+mv4 \
-trellis 1 -mbd 2 -cmp 2 -subcmp 2 -threads 0 -acodec aac \
-ac 2 -ab 128k ${outfile}
fi
done
}
@oc
Copy link
Author

oc commented Apr 29, 2011

H264 + AAC (just as slow...)


      time ${FFMPEG} -y -i ${file} -f mp4 -metadata title=${title} \
          -timestamp ${timestamp} -vcodec libx264 -level 30 -b 1024k \
          -bt 1024k -bufsize 10M -maxrate 10M -g 250 -coder 0 \
          -flags +loop -cmp +chroma \
          -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs \
          -me_method umh -subq 6 -trellis 1 -refs 3 -me_range 16 \
          -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 \
          -qmax 51 -qdiff 4 -threads 0 -acodec aac -ac 2 -ab 128k \
          ${outfile}

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