VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date: Feb 2004
    Location: Italy
    Search Comp PM
    Hi,
    I?m working with MeGUI since 3 years. But now I want to improve the better quality I can obtain during encoding H264 movies in order to get good quality and a average compression.

    My goal is to get some video compressed to get dimension of DVD-5 or DVD-9, but I want the best image ever.

    I often use Profile 4.1, with 2 pass encoding and with a bitrate calculated with MeGUI in order to get a final mkv file that can be burned into dvd-5 or dvd-9.

    This is my default used profile:

    cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=esa / subme=9 / psy=0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=23 / keyint_min=1 / scenecut=0 / intra_refresh=0 / rc_lookahead=23 / rc=2pass / mbtree=1 / bitrate=6268 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00

    where the bitrate is always calculated.

    What do you think about this config?

    A little note: my final MKV file must be compatible with Stand Alone Bluray Player, like LG BD-370.

    Thanks in advantage.
    Quote Quote  
  2. Member leghorn's Avatar
    Join Date: Apr 2007
    Location: Germany
    Search Comp PM
    Personally, I don't go into detail when setting up x264. In MeGUI I've created my own presets simply invoking:

    x264 --preset veryslow --tune xxx* --crf=zzz** --level 4.1 -o "output file" "input file"

    * - depends on source: film or animation
    ** - zzz = 16.5 for DVD sources, 17 or 18 for HD sources, 19 or 20 for grainy stuff like e.g. Aliens

    No complaints yet.

    Btw, I don't care about DVD-5 or -9. I connect an external HD to my stand-alone player and watch via USB.
    Das Leben ist eine Nebelwand voller Rasierklingen. (C. Bukowski)
    Quote Quote  
  3. It looks much like preset very slow to me, except with a few less reference frames.

    Scenecut=0. Why's that?

    You should get better compression with the default keyint values. Something like keyint=250 and keyint_min=23. Then you could use rc_lookahead=40 or more (40 is the default for the medium speed preset). The player mightn't seek as smoothly using the default keyint values but I'd be surprised if they stopped it from playing the encoded video. I use keyint=250/240 (depending on the frame rate) and both the Bluray players in this house are happy with it.
    Quote Quote  
  4. Member
    Join Date: Feb 2004
    Location: Italy
    Search Comp PM
    Thank you very much for your help.

    This is my new (and I think the last) preset:

    cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=esa / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=0 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=6268 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=62500 / vbv_bufsize=78125 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00

    Please, let me know your thought.

    Thanks again! I appreciate it so much!
    Quote Quote  
  5. Originally Posted by klode View Post
    Please, let me know your thought.
    Even though I asked why you're using scenecut=0 and you didn't reply?

    I'm not an expert on x264's settings but if you selected the slower preset and tune film, changed the deblock settings back to zero and reduced reference frames from 8 to 5, I'm pretty sure you'd have your settings, so they don't appear to be anything out of the ordinary. Except for scenecut=0. Is there a reason you chose that?
    Quote Quote  
  6. Member
    Join Date: Feb 2004
    Location: Italy
    Search Comp PM
    I don't know, dear hello_hello, where scenecut is setted.

    But, on this configuration, what do you should change for a better compression and quality?
    Quote Quote  
  7. I'm really no expert on x264's settings in respect to tweaking them as I've rarely done it. I'm a little surprised nobody else has commented here, but IMO there's really no magic "encodes everything better" tweaking to be done. If you could tweak setting "A" and improve the quality of one encode a tiny, tiny bit, the next video might require tweaking setting "B" instead. That's why I do what leghorn does.
    I pick a CRF value (or in your case bitrate) I'm happy with, and an appropriate x264 tuning (none, film, grain etc). Then I use the slowest speed preset I can stand at the time. I rarely use anything other than "medium" or "slow". Your settings appear to be very similar to the "slower" speed preset and tune "film".
    Tune "film" sets deblock=1:-1:-1 and psy_rd=1.00:0.15 (the latter you've already done).

    Because I always use CRF encoding, I can tell you deblock=1:-1:-1 and psy_rd=1.00:0.15 would both increase the bitrate for a given CRF value, so they're probably helping retain more fine detail, but when it comes to encoding using a fixed file size I couldn't tell you what to expect. You've only got "x" number of bits to encode with, so I'd assume if changing a setting causes the quality to increase in one area it might also reduce it in another.... someone who does a lot of 2 pass encoding could probably offer a more informed opinion there, but I'd just be using an appropriate tuning for each encode myself.

    I asked about scenecut as the default is 40 and given you've changed it I assumed you had a reason for doing so. The Scenecut value controls how sensitive to scene changes the encoder is. If it detects a scene change, the first frame in a scene would usually be a keyframe. It's probably the best place to put them. According to the x264 wiki, secencut=0 is the same as using --no-scenecut.
    http://mewiki.project357.com/wiki/X264_Settings#scenecut

    Types of keyframes:
    http://www.afterdawn.com/glossary/term.cfm/idr_frame
    http://www.afterdawn.com/glossary/term.cfm/i_frame

    With scenecut=0 and keyint=240 you'll probably have keyframes spread out at nice 10 second intervals from start to finish, but to be honest I could only guess as to how that'd effect the quality. Keyframes require the most bits to encode and are probably the highest quality frames. Previously you likely had a keyframe every second (google "keyframe pumping)". Maybe putting them at the beginning of a scene with a maximum interval of ten seconds is a good quality/compression compromise..... which if I remember correctly, is the default setting.
    Last edited by hello_hello; 26th Mar 2014 at 03:47.
    Quote Quote  
  8. For "best image quality" maybe to a certain extent you're looking in the wrong place.

    For high quality HD sources I which are fairly clean (ie not noisy or grainy) I generally encode them "as-is". Most filtering which improves quality in one area can potentially reduce it in another (for example removing noise can tend to blur fine detail) so ideally you'd use a high quality source with no filtering. In the real world though.....

    Noise removal and picture stabilisation can improve things much more than encoder tweaking, although once again there's really no "one size fits all" filter. If you want to experiment with Avisynth filters and have the patience (if you've not added filters to a script manually before it can take a bit of trial and error to find the correct plugins and make it work) here's a few suggestions.....

    QTGMC is primarily a deinterlacer, but it has a progressive mode which works very well for stabilising the picture (I use it a lot when re-encoding "wobbly" old xvid/AVIs). It also has built in noise filtering which can be enabled and adjusted. It can remove quite a bit of noise without blurring as much as other filters. It's also very slow. QTGMC can be run in multi-threaded mode with a multi-threaded version of Avisynth but I just use the standard Avisynth myself. For re-encoding noisy (progressive) video I'd just add something like this to the script:

    QTGMC(InputType=1, Ezdenoise=2)

    Temporal Degrain is possibly a little better than QTGMC at removing noise but it doesn't stabilise the picture as much. It's just as slow.

    There's a script here which works well for removing light to medium noise. It's quite fast. There's a link in the post to the plugins required in order to use it.
    Quote Quote  
  9. For DVD you have to limit max. bitrates, so it is not higher than 18000 kbps

    The limitation is what your player will accept, how many ref. frames for what resolution you do not even mention video resolution.

    I'd do this, first calculate average bitrate, you get a sense what resolution you need then, then resize video in Avisynth (or not) and then use 2pass encoding:

    Code:
    x264 --preset medium   --pass 1 --bitrate your_average_bitrate  --ref yyy --tune xxx   --vbv-bufsize 15000 --vbv-maxrate 14000 --output NUL "input.avs"
    x264 --preset medium   --pass 2 --bitrate your_average_bitrate  --ref yyy --tune xxx   --vbv-bufsize 15000 --vbv-maxrate 14000 --output "out.mp4" "input.avs"
    where
    -yyy depends on video resolution
    -xxx if you denoise in Avisynth or not or you want to keep noise (less compressibility)

    I would not get my head spin too much about those settings, just try that default preset - medium, then slow (limiting ref frames), check with your player .
    Last edited by _Al_; 26th Mar 2014 at 11:02.
    Quote Quote  



Similar Threads