VideoHelp Forum

+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Hi,

    I'm using a video editor (VSDC) that processes the parameters CFR, Quality and PRESET (Ultra Fast, Very Fast, ..., Very slow) among others when encoding with X264, which the user can specify.

    What I have understood so far: The smaller the value for CFR, the more lossless the encoding. But I don't understand so far how QUALITY and PRESET affect the visual video quality with all other parameters remaining the same.

    When I select one of the presets, for example Very slow, the displayed value of QUALITY does not change in VSDC's Profile Editor. This surprises me, because until now I assumed that in a selected PRESET a certain QUALITY value is also anchored.

    If I change the PRESET from Ultra Fast to Very Slow with the same values for QUALITY and CFR, the generated video file becomes SIGNIFICANTLY smaller.
    Yet I read in various places that Very Slow supposedly produces better visual quality than, say, Ultra Fast. Despite a partially strongly reduced file size of the generated video file.

    Is this true?

    My goal is to produce a very good visual quality that approximates the source material, since it is already X264 encoded (Panasonic G9 videos).
    The resulting file size is secondary and less important to me than the visual quality.


    Thanks for your help and kind regards
    videotestit
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    x264 can use CQ (constant quality) or CRF (control rate factor); I'm not sure what context you're referring to "quality" in your post,
    perhaps you put up some screen cap showing the export options. CRF has some added intelligence Vs. CQ to further reduce the file size
    by taking perceived quality into account (For example, it may raise the quantization value in area's with motion where it wont be noticed)

    The encoder has a variety of techniques it can use, resulting in the speed differences in the presets. See this post by jagabo
    https://forum.videohelp.com/threads/392913-What-settings-when-converting-video#post2554158

    EDIT If your file is already x264, why not leave it as-is?
    Last edited by davexnet; 6th Jul 2022 at 02:32.
    Quote Quote  
  3. Originally Posted by davexnet View Post
    x264 can use CQ (constant quality) or CRF (control rate factor); I'm not sure what context you're referring to "quality" in your post,
    ...
    Hi,

    thanks for your reply!

    I wrote "visual quality" and that I want to get a result that deviates as little as possible in terms of its visual quality from the original, which was also already lossy X264 encoded by my camera during video capture.

    Best regards
    videotestit
    Quote Quote  
  4. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    No one can truly guide you on 'visual quality' since that, as its name implies, is in the eyes of the beholder. So what one individual might perceive as good quality visually will appear to another as 'rubbish'

    As our friend has already stated, and you now confirm, you already have a lossy source. Compress that again and you lose actual quality = real data. So it may still look ok to you........
    Quote Quote  
  5. Lower CRF allows for near lossless video compression but increases filesize a lot.

    Using a slower x264 preset allows for better compression and slightly better quality at the same CRF.

    CRF18 with the normal preset will yield much better quality than very slow with CRF26.
    Quote Quote  
  6. Originally Posted by DB83 View Post
    No one can truly guide you on 'visual quality' since that, as its name implies, is in the eyes of the beholder. So what one individual might perceive as good quality visually will appear to another as 'rubbish'
    Sorry, but this is nonsense insofar as I had written:

    My goal is to produce a very good visual quality that approximates the source material, since it is already X264 encoded (Panasonic G9 videos).

    Therefore, it is of course possible to determine which result is closest to the already compressed original. Without this restriction explicitly mentioned by me, you would be right, of course.

    Kind regards
    videotestit
    Quote Quote  
  7. Originally Posted by butterw View Post
    Lower CRF allows for near lossless video compression but increases filesize a lot.

    Using a slower x264 preset allows for better compression and slightly better quality at the same CRF.

    CRF18 with the normal preset will yield much better quality than very slow with CRF26.
    Thanks for that clear statement!

    Kind regards
    videotestit
    Quote Quote  
  8. Originally Posted by videotestit View Post
    the original, which was also already lossy X264 encoded by my camera during video capture.
    You are probably not going to improve the quality.
    Sometimes a new encode will correct a problem with playing a video.

    Use a software like MediaInfo & get the stats on the original.
    Make your settings similar to those.

    I usually use ffmpeg for something like this.
    Quote Quote  
  9. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Presumably the OP wants to reduce the size of the file, but it's just a guess because it's not stated explicitly.
    This has been discussed ad nauseam in this forum, plenty of good threads on the subject
    Quote Quote  
  10. Originally Posted by cholla View Post
    Originally Posted by videotestit View Post
    the original, which was also already lossy X264 encoded by my camera during video capture.
    You are probably not going to improve the quality.
    Sometimes a new encode will correct a problem with playing a video.

    Use a software like MediaInfo & get the stats on the original.
    Make your settings similar to those.

    I usually use ffmpeg for something like this.
    Thanks,

    Of course the original data already compressed will not become better being compressed again.

    What one can do concerning "visual quality" are improvements like noise reduction, gamma correction etc..

    In my case I cut the original videos with "LosLess cut" and have to adapt the speed because the original videos have been recorded with 180 fps to create Slow Motion Clips and I need the same clip with "normal" speed so that they have to be converted. And that is why they have to be reencoded - resulting in the question, which parameters I can use for best visual quality similiar to the original.

    Kind regards
    videotestit
    Quote Quote  
  11. Originally Posted by davexnet View Post
    Presumably the OP wants to reduce the size of the file, but it's just a guess because it's not stated explicitly.
    This has been discussed ad nauseam in this forum, plenty of good threads on the subject
    Hi,

    NO, the file size is not important for me what I already emphasized in my 1st post:
    "My goal is to produce a very good visual quality that approximates the source material, since it is already X264 encoded (Panasonic G9 videos).
    The resulting file size is secondary and less important to me than the visual quality."
    Best regards
    videotestit
    Quote Quote  
  12. Originally Posted by butterw View Post
    Lower CRF allows for near lossless video compression but increases filesize a lot.

    Using a slower x264 preset allows for better compression and slightly better quality at the same CRF.

    CRF18 with the normal preset will yield much better quality than very slow with CRF26.
    Hi,

    what is a bit difficult for me to understand is that "Very Slow" with a higher compression ratio is supposed to produce a visually better result (more similar to the source) than, for example, "Very fast", since a more lossy compressed file usually has a worse quality than a weaker compressed one. This is not different with JPEGs.

    How does this explain itself?

    Best regards
    Videotestit
    Quote Quote  
  13. Very slow uses more complex techniques to achieve the better compression/quality.
    Last edited by butterw; 6th Jul 2022 at 15:06.
    Quote Quote  
  14. Originally Posted by butterw View Post
    Very slow uses more complex techniques to achieve the better compression/quality.
    Hi,

    better Compression is okay!
    But better compression usually does not mean that the same visual quality is produced.

    Do I have to imagine that Ultra Fast, Very fast, ..., Very slow all produce the same visual quality but different file sizes if the rest of the parameters remain the same, e.g. always CRF value 18?

    Kind regards
    videotestit
    Quote Quote  
  15. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Quote Quote  
  16. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    For what its worth, here are two samples. The first is a CRF 18 slow preset conversion from a lossless source. The second takes the first file and encodes that again, just as you propose to do, again at CRF 18 slow. Result is a 25% file size reduction. My eyesight is poor and you know which is which but can you detect loss of 'vidual quality' in the second sample ? Data loss, yes.
    Image Attached Files
    Quote Quote  
  17. Originally Posted by videotestit View Post
    Do I have to imagine that Ultra Fast, Very fast, ..., Very slow all produce the same visual quality but different file sizes if the rest of the parameters remain the same, e.g. always CRF value 18?
    As you increase the complexity of encoding from Ultra fast to Very Slow at CRF18:
    - Encoding time increases.
    - Filesize will first decrease sharply, then reach a roughly flat decreasing level.
    - Quality will increase sharply then reach a roughly flat increasing level. Typically quality is measured with a metric called VMAF.

    For streaming maybe medium is good enough, to achieve best quality use Slower or Very Slow.
    Quote Quote  
  18. Originally Posted by videotestit View Post
    what is a bit difficult for me to understand is that "Very Slow" with a higher compression ratio is supposed to produce a visually better result (more similar to the source) than, for example, "Very fast", since a more lossy compressed file usually has a worse quality than a weaker compressed one.
    h.264 encoding is not a single algorithm. It's a very complex bag of tricks. Some of the algorithms are fast but don't compress much. Some are slow but compress more. Some produce more accurate results (and sometimes higher bitrates) but are also slower. As you move to slower presets in x264 it uses more of the slower and more accurate settings.

    With the exception of ultrafast and superfast, there's not much difference in file size between the various presets:

    Image
    [Attachment 65773 - Click to enlarge]


    That's the size (in KiB) of a particular (but not atypical) short video encoded with the different presets. The bar on the left is ultrafast, followed by superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo. All at crf 18 with no other manual changes.

    Here's a list of the parameters used for each preset:

    Code:
    ultrafast: cabac=0 / ref=1  / deblock=0:0:0 / analyse=0:0       / me=dia  / subme=0  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0  / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0                                                                           / weightp=0 / keyint=250 / keyint_min=23 / scenecut=0  / intra_refresh=0                   / rc=crf / mbtree=0 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=0
    superfast: cabac=1 / ref=1  / deblock=1:0:0 / analyse=0x3:0x3   / me=dia  / subme=1  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0  / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3  / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0                   / rc=crf / mbtree=0 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
    veryfast:  cabac=1 / ref=1  / deblock=1:0:0 / analyse=0x3:0x113 / me=hex  / subme=2  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0  / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3  / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    faster:    cabac=1 / ref=2  / deblock=1:0:0 / analyse=0x3:0x113 / me=hex  / subme=4  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0  / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3  / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=20 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    fast:      cabac=1 / ref=2  / deblock=1:0:0 / analyse=0x3:0x113 / me=hex  / subme=6  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3  / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    medium:    cabac=1 / ref=3  / deblock=1:0:0 / analyse=0x3:0x113 / me=hex  / subme=7  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3  / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    slow:      cabac=1 / ref=5  / deblock=1:0:0 / analyse=0x3:0x113 / me=umh  / subme=8  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / 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=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    slower     cabac=1 / ref=8  / deblock=1:0:0 / analyse=0x3:0x133 / me=umh  / subme=9  / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / 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=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    veryslow:  cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh  / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8  / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    placebo:   cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=tesa / subme=11 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40                 / aq=1:1.00
    (That list was made several years ago, there may have been minot changes since then.) You can see settings like reference frames increase with the preset. More reference frames potentially allow for more comperssion but take longer since the encoder has to compare more frames. Other settings like subme (sub pixel motion estimation) will give more accurate results (smoother edges on moving objects) but may require a little more bitrate.

    For standard definition video I usually use crf 18 with the slow preset. That gives a result with barely noticeable degradation at normal playback speed but if you zoom in on still frames you'll see differences.
    Last edited by jagabo; 6th Jul 2022 at 16:43.
    Quote Quote  
  19. Originally Posted by jagabo View Post
    That's the size (in KiB) of a particular short video encoded with the different presets. The bar on the left is ultrafast, followed by superfast, veryfast, faster, fast, medium, slow, slower, veryslow, and placebo. All at crf 18 with no other manual changes.
    Perhaps to remember (if not already said before) that CRF does not stand for an absolute quality. Means that even though all are encoded with the same CRF=18, the visual (or "objectively" measured) quality will usually be different. How much different depends on the particular source characteristics.
    Also, it might in practice not even be desirable to replicate an already compressed source as closely as possible, as one might have to waste bitrate and encoding time simply for precisely reproducing the artefacts of the compressed source. Filtering is key then, but that's another topic.
    Last edited by Sharc; 6th Jul 2022 at 17:00.
    Quote Quote  
  20. Hello,

    thank you very much for all your tips, which have helped me a lot and contribute to my understanding of the matter.

    Kind regards
    videotestit
    Quote Quote  



Similar Threads