Convert mkv/h264 video so it can be played on a "mid-range" Sony Ericsson phone. (using Ubuntu)
Solution 1:
Why not try Handbrake? It's available for Linux, Mac Os and Windows and also has a command line interface, if you want.
Here's a guide to the Handbrake CLI.
Solution 2:
I cant get it any better than this ffmpeg example:
ffmpeg -i Star_Wars.mkv -acodec libfaac -ab 60k -s 320x240 -vcodec libx264 -b 500k -flags + loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -m e_method umh -subq 6 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 500k -maxrate 768k -bufsize 2M -qcomp 0 .6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -threads 0 -f mp4 Star_Wars.mp4
This converts a 50min tv-episode (4:3) into a 70Mb file (was 700Mb before)
and a 2h movie (16:9) into a 470Mb file (was 1700Mb before)