[mythtv-users] Downscale HD recordings with ffmpeg

Philippe Van Der Gucht philippe at vandergucht.org
Mon Mar 16 18:12:30 UTC 2009


belcampo wrote:

> My goal is "visibly the same quality" and "light on file-size".
> 
> I use this:
> 
> ffmpeg -i source.mpg -vcodec libx264 -b 2772k -flags +loop -coder 1 
> -refs 2 -deblockalpha 0 -deblockbeta 0 -partitions +parti4x4 -partitions 
> +partp8x8 -partitions +partb8x8 -partitions +parti8x8 -me_method umh 
> -subq 7 -me_range 24 -cmp +chroma -bf 0 -b_strategy 1 -g 250 -keyint_min 
> 25 -sc_threshold 40 -maxrate 4500k -r 25 -qmin 16 -qmax 32 -s 896x720 
> -aspect 16:9 -acodec libfaac -ab 192k -ar 48000 -ac 6 -f mpegts result.ts

Have you considered making this a 2-pass process and if not, why not?

Also, using presets make it a bit more readable. I like what this person 
has come up with:
http://rob.opendot.cl/index.php/2008/09/17/ffmpeg-libx264-presets/

I managed to get it working after a fair bit of tweaking:

1st pass:
ffmpeg -i in.mpg -an -pass 1 -vcodec libx264 -vpre fastfirstpass -b 
2772k -bt 2772k -s hd720 -sws_flags lanczos out.mpg

2nd pass:
ffmpeg -i in.mpg -pass 2 -vcodec libx264 -vpre hq -b 2772k -bt 2772k 
-map 0.0:0.0 -map 0.3:0.1 -map 0.2:0.2 -acodec copy -scodec copy -s 
hd720 -sws_flags lanczos -y -f mpegts -threads 0 out.mpg

hq preset:
I had to comment the 'bf' option, would report invalid with it.

fastfirstpass preset, changed these 2 lines (IIRC):
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
flags2=-bpyramid-wpred-dct8x8+fastpskip

I must the result looks pretty impressive (YMMV). :-)



-- 
                  WARNING TO ALL PERSONNEL:

Firings will continue until morale improves.
* TagZilla 0.066 * http://tagzilla.mozdev.org


More information about the mythtv-users mailing list