Anyone have any good ffmpeg parameters for converting video? I use MakeMKV to convert my DVDs to streamable files at home, but sometimes I want them on my SD card for when I'm on a plane. Recently I created a script that converts my MKV files to MP4s. It turned a 2GB, 53 minute MKV into a 100MB file which plays at a reasonable quality (at least locally, it may be different via HDMI).
Anyone use different settings or have a more interesting script for this?
Here's my "mkv-convert" script:
Anyone use different settings or have a more interesting script for this?
Here's my "mkv-convert" script:
Code:
#!/bin/bash
# Uses FFMPEG to convert files to something mobile-friendly at 320x240 and a
# small filesize.
#
# May need to install medibuntu repositories:
# apt-get --yes -q --allow-unauthenticated install medibuntu-keyring
# sudo apt-get -q update
# sudo apt-get install ffmpeg libavcodec-extra-52
if [ $# = 0 ]; then
echo Usage: $(basename $0) filename
echo ""
echo Output will be an mp4 file at 320x240.
exit 1
fi
for infile in $*
do
if [ -f $infile ]; then
outfile=${infile%\.*}.mp4
echo $infile to $outfile
ffmpeg -i $infile -y -vcodec libx264 -s qvga -acodec libfaac -ab 96k -ac 2 \
-b 200K -threads 4 -flags +loop -cmp +chroma -partitions 0 \
-me_method epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 \
-g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M \
-bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 \
-qmax 51 -qdiff 4 -level 30 $outfile
fi
done