VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Will different presets in x264 affect the video quality, if I'm using CRF value 0?

    For example, will ultrafast preset produce as good quality as placebo, with CRF 0?
    Quote Quote  
  2. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Should just affect the file size, faster settings giving bigger files.
    Quote Quote  
  3. Member
    Join Date
    Dec 2005
    Location
    Pocatello, ID
    Search Comp PM
    In general, your CRF is what determines the quality. 0 should be the same, regardless of what speed you used.

    I refer you to Matt Gadient's Guide and his explanation of:
    -Encodes fast
    -High quality
    -Smallest file size possible

    Pick 2


    https://mattgadient.com/2013/06/12/a-best-settings-guide-for-handbrake-0-9-9/
    Quote Quote  
  4. set --qp 0 , not --CRF 0

    YUV video to get High 4:4:4
    x264.exe --qp 0 --keyint 30 --profile high444 --output out.264 input_yuv.avs
    -GOP is 30 frames long, you do not want to have it default 250 frames long, not sure what is the reason to have lossless H.264
    -to specify profile high 4:4:4 might not be necessary and it is created automatically
    Quote Quote  
  5. Originally Posted by _Al_ View Post
    set --qp 0 , not --CRF 0

    YUV video to get High 4:4:4
    x264.exe --qp 0 --keyint 30 --profile high444 --output out.264 input_yuv.avs
    -GOP is 30 frames long, you do not want to have it default 250 frames long, not sure what is the reason to have lossless H.264
    -to specify profile high 4:4:4 might not be necessary and it is created automatically
    I'm using Ripbot264 and I'm not very familiar with different command line options in encoding. Ripbot doesn't even give an option "--gp".
    Last edited by Juha; 12th May 2016 at 05:51.
    Quote Quote  
  6. I made 2 encodings with CRF 0, using both ultrafast and placebo presets. The output looks like exactly same for both.

    First sample:

    Ultrafast:

    http://i.imgbox.com/U5jRtBwX.png

    Placebo:

    http://i.imgbox.com/Y1jSPRpl.png


    Second sample:

    Ultrafast:

    http://i.imgbox.com/Ps6E6Xug.png

    Placebo:

    http://i.imgbox.com/AfjtYzQl.png


    Third sample:

    Ultrafast:

    http://i.imgbox.com/FrnFywzy.png

    Placebo:

    http://i.imgbox.com/ERkWyowe.png
    Quote Quote  
  7. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    "Looks like" is no valid criterion for "being lossless". Did you calculate the difference between both pictures, possibly with contrast enhancement, to check whether they are really identical?

    If one of both videos would have a worse quality, then the conversion would not be "lossless". If both conversions are "lossless", their quality must both be the same, 100%.

    A "constant quantizer" mode with value 0 (--qp 0) will provide lossless compression (down to the color space and chroma subsampling). A "constant rate factor" (CRF) mode will not guarantee this to the last bit.
    Quote Quote  
  8. *double*
    Last edited by Juha; 12th May 2016 at 09:12. Reason: double
    Quote Quote  
  9. Sorry my previous comment, it looks like Ripbot264 allows to customize options after all.

    Is this ok? I added "--gp 0" there.

    --level 4.0 --gp 0 --preset faster --aud --nal-hrd vbr --vbv-bufsize 25000 --vbv-maxrate 25000
    Quote Quote  
  10. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    q (from "quantization") is a lower case Q, not G.

    Furthermore: Forget lossless encoding and VBV. Your bitrate will explode. If you want lossless encoding, expect huge results, certainly not compatible to any consumer video format.
    Quote Quote  
  11. q (from "quantization") is a lower case Q, not G.
    Oops, thank you for pointing that out!

    Furthermore: Forget lossless encoding and VBV. Your bitrate will explode. If you want lossless encoding, expect huge results, certainly not compatible to any consumer video format.
    I don't mind even if my settings will result a huge file. My intention is to edit some video and then upload it to Youtube, and since Youtube will always re-encode uploaded videos, I want to edit losslessly. I have a good upload bandwidth and I'm going to delete the output file after I have sent it to Youtube.

    Thanks for help!
    Quote Quote  
  12. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    In this case...

    Really lossless quality is not necessary, "visually transparent" will be enough (CRF around 6..12 is good enough not to see a difference, yet get some compression still).

    But what's quite important for YouTube is to upload a high resolution. FullHD 1080p should be a minimum to achieve still a convenient playback quality in lower resolutions, reencoded by YouTube. Even upscaling to an UHD resolution may give some quality gain. Look for more existing threads about that topic.
    Quote Quote  
  13. Member
    Join Date
    Dec 2005
    Location
    Pocatello, ID
    Search Comp PM
    Originally Posted by Juha View Post
    q (from "quantization") is a lower case Q, not G.
    Oops, thank you for pointing that out!

    Furthermore: Forget lossless encoding and VBV. Your bitrate will explode. If you want lossless encoding, expect huge results, certainly not compatible to any consumer video format.
    I don't mind even if my settings will result a huge file. My intention is to edit some video and then upload it to Youtube, and since Youtube will always re-encode uploaded videos, I want to edit losslessly. I have a good upload bandwidth and I'm going to delete the output file after I have sent it to Youtube.

    Thanks for help!
    I don't think you understand how much bigger it would be to use the "0" setting. It will be so large that it will be almost unusable, let alone uploadable. If you want true lossless then just remux and forget about re encoding altogether.
    Quote Quote  
  14. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Indeed; x264 is a quite efficient compressor, it is possible to achieve a convenient result with a compression ratio of about 1:1000 (compared to uncompressed YUV 4:2:0 a.k.a. "YV12"). But lossless video codecs hardly reach a compression ratio of 1:5 ... that means, you would have to deal with at least 200x the size you were used to.
    Quote Quote  
  15. Thank you for your tips.

    My source material is DVD quality. If I edit it in a lossy way (let's say I use CRF value 6) but I also upscale it to Full HD resolution, would it be better on Youtube, than losslessly edited video at dvd resolution?
    Quote Quote  
  16. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Originally Posted by LigH.de View Post
    A "constant rate factor" (CRF) mode will not guarantee this to the last bit.
    I was under the impression it did but could be wrong.

    Anyway here are the subtraction photos done in avisynth, and each pair of images provided by OP have the exact same CRC-32 hash.

    Click image for larger version

Name:	Placebo000000.png
Views:	846
Size:	8.4 KB
ID:	36995Click image for larger version

Name:	Placebo000000.png
Views:	846
Size:	8.4 KB
ID:	36995Click image for larger version

Name:	Placebo000000.png
Views:	846
Size:	8.4 KB
ID:	36995

    Code:
    #example of script used on each subtraction image
    A=ImageSource("...Ultrafast_2.png")
    B=ImageSource("...Placebo_2.png")
    Subtract(A,B)
    Last edited by KarMa; 12th May 2016 at 18:03. Reason: example script
    Quote Quote  
  17. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Yes, --crf 0 is lossless. At least with 8-bit x264. I see some old posts saying that 8-bit input to 10-bit output will not be lossless with --crf 0.
    Quote Quote  
  18. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    For fun I took the frog image and then converted it to JPEG using different quality settings, then subtracted the JPEG from the PNG source.

    JPEG Quality=100 in Paint.NET (4:1 Compression ratio over the PNG)
    Click image for larger version

Name:	Compare.png
Views:	1102
Size:	953.0 KB
ID:	36998

    JPEG Quality=50 in Paint.NET (32:1 Compression ratio over the PNG)
    Click image for larger version

Name:	Compare50.png
Views:	1018
Size:	1.20 MB
ID:	36999

    Should point our the PNG image is already losslessly compressed and so skewing down the compression ratio, which would be higher compared to raw BMP.
    Last edited by KarMa; 13th May 2016 at 18:11.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!