Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | Link |
|
Registered User
Join Date: Oct 2007
Posts: 3
|
Optimal ffmpeg/x264 settings for general h264 for Flash, and some general questions
I am trying to encode a large variety of videos and want to come up with the best general-purpose x264 options (that won't require prior knowledge of the content). The target format will be MP4, to be played back in the new Flash Player with h264 support.
I started with the settings outlined in this guide, which suggests the ffmpeg default options are far lower quality than the x264 CLI's defaults. The guide explains how to get ffmpeg back in line with x264's defaults. Here are example command lines (straight from the guide linked above) for the first and second pass: Things of note:
Thanks for any suggestions or tips. Last edited by putnam; 28th January 2008 at 20:04. |
|
|
|
|
|
#2 | Link |
|
x264 developer
Join Date: Sep 2005
Location: Claremont, CA
Posts: 7,250
|
1. x264's 1-pass ratecontrol is pretty bad. Either use CRF for 1pass, or use 2pass bitrate mode.
2. It supports High Profile, so use High Profile features: i8x8 partitions, 8x8dct, etc. I'd also enable bime, raise subq to 6 or 7, enable weightb, and enable b-rdo. 3. x264's threading is extremely efficient. If you want to use it, there is no disadvantage to doing so. |
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Oct 2007
Posts: 3
|
Of these options, which ones can I skip in the first pass to save some time? I am currently running first pass with subq 1, then increase it in the second pass. Can I leave off weightb/bime/b-rdo in the first pass? I take it I need to leave partition searching the same.
|
|
|
|
|
|
#4 | Link | |
|
x264 developer
Join Date: Sep 2005
Location: Claremont, CA
Posts: 7,250
|
Quote:
|
|
|
|
|
|
|
#5 | Link | |
|
Software Developer
Join Date: Jun 2005
Location: Germany
Posts: 7,813
|
Quote:
* turbo=1 - Reduce subq, frameref and disable some inter-macroblock partition analysis modes. * turbo=2 - Reduce subq and frameref to 1, use a diamond ME search and disable all partition analysis modes.
__________________
MPlayer for Win32 | Avidemux for Win32 | LameXP Audio Encoder | x264 explained | F@H | My Specs |
|
|
|
|
|
|
#6 | Link | |
|
Registered User
Join Date: Jan 2008
Posts: 45
|
Quote:
But I just ran into an odd thing - changing crf from 21 to 24 changed the file size by only 4KB on the last encode (598,264KB to 598,261KB). I'm used to crf having larger differences in output file sizes when switching from 24 to 21, but that was before adding the High Profile settings. The video looks fine, but I'm just wondering if something isn't working here, or if its normal for crf to sometimes do this? Settings: ffmpeg -i "C:\VTS_03_1.VOB" -r 29.97 -threads auto -vcodec h264 -croptop 54 -cropbottom 58 -s 704x304 -aspect 2.31578947 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -crf 21 -bt 512k -refs 5 -bf 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -flags2 +brdo+mixed_refs+wpred+dct8x8+bpyramid -g 250 -keyint_min 25 -qmin 10 -qmax 51 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec aac -ab 128k -ar 48000 -ac 2 "C:\done.mp4" |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|