ffmpeg to convert videos

jdbower

Well-known member
Jul 2, 2010
615
59
0
Visit site
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:
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
 

someguy01234

Well-known member
Nov 9, 2011
1,813
2
0
Visit site
There are some other ffmpeg gui like WinFF and Mobile Media Converter, though they never work that well all the time. In Handbrake, you can convert MP4 video and change video codec to ffmpeg, which convert much faster than x264, but lower quality.

The problem with Handbrake is it has bugs and crash with lots of videos. So actually I use Avidemux, best crossplatform video transcoder.
 

Forum statistics

Threads
944,379
Messages
6,922,564
Members
3,159,524
Latest member
Michaelcook