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.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd December 2017, 20:52   #1  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
x265 and preset influence with CRF ?

Hi,
I would like to encode some Blu ray to x265 and I read some informations on Google about presets but never the same result.
So does preset with CRF have an influence on the quality or only on the bitrate ? Medium seems to be a good choice but if slow gives a better quality I may use it.
Thank you !
Nico8583 is offline   Reply With Quote
Old 3rd December 2017, 21:39   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,671
Preset has influence on both speed and quality. But you can have same quality with medium as with e.g. slow - you just need more bitrate.

Step 1: choose preset according to speed you are willing to accept
Step 2: adjust CRF until you have quality/bitrate you are willing to accept (strictly speaking CRF also has some impact on speed so you may need to repeat the process)
sneaker_ger is offline   Reply With Quote
Old 3rd December 2017, 22:15   #3  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you !
Medium's speed is good for me, slow is a little bit "slow" and slower is too slow. What is the vein approximatively between preset and CRF ? For example is Medium / CRF18 similar to Slow / CRF20 or more ? I know it's related to my choice but I would like to know a base to start.
Nico8583 is offline   Reply With Quote
Old 5th December 2017, 19:55   #4  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
I have found this on the FFMPEG website (https://trac.ffmpeg.org/wiki/Encode/H.265) :
Quote:
Choose a preset. The default is medium. The preset determines how fast the encoding process will be at the expense of compression efficiency. Put differently, if you choose ultrafast, the encoding process is going to run fast, but the file size will be larger when compared to medium. The visual quality will be the same. Valid presets are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow and placebo.
Nico8583 is offline   Reply With Quote
Old 5th December 2017, 21:31   #5  |  Link
jd17
Registered User
 
Join Date: Jun 2017
Posts: 54
This does not apply to x265. It did not even really apply to x264.
However, in x265 the files do not even get bigger with faster presets, they mostly get smaller.

Generally speaking, results with medium look good, fast is still ok, but you should not go faster than that.
Make a few comparisons, you will see why.

The speed drops significantly if you go to slow, yes - but it is worth it. Slow (and the slower presets) keep(s) considerably more detail.
In my humble opinion, slow is the sweetspot for quality/speed. Others see slower as that sweetspot, I think because it makes pretty much full use of x265's efficiency potential.


I linked my personal table here, maybe it helps you too:
https://forum.doom9.org/showthread.p...10#post1820010

Essentially, you can't really go wrong with slow, a CRF below 20 and --no-sao. But again, this is just my opinion based on my personal findings and some good advice here.
jd17 is offline   Reply With Quote
Old 5th December 2017, 22:34   #6  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you, I'll look at it
Just a point : why do you use 10bit with 8bit sources ?
Nico8583 is offline   Reply With Quote
Old 6th December 2017, 04:24   #7  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 2,715
It is less significant with x265 but 10bit encoding is more efficient.

http://x264.nl/x264/10bit_02-ateme-w..._bandwidth.pdf
__________________
madVR options explained
Asmodian is online now   Reply With Quote
Old 6th December 2017, 13:35   #8  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
I didn't know, thank you for the link
So 10bit is more efficient but I need to know if all my players are able to read 10bit sources...
Nico8583 is offline   Reply With Quote
Old 7th December 2017, 00:16   #9  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,395
Quote:
Originally Posted by Nico8583 View Post
I didn't know, thank you for the link
So 10bit is more efficient but I need to know if all my players are able to read 10bit sources...
Lots of mobile HEVC decoders don't support 10-bit decode. The current major chipsets do, but there are a lot deployed that don't.

10-bit is also somewhat more memory and power intensive to decode.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Instant Video

My Compression Book

Amazon Instant Video is hiring! PM me if you're interested.
benwaggoner is offline   Reply With Quote
Old 7th December 2017, 08:17   #10  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you for this information.
So 10bit is more efficient but you don't recommend to use it for more compatibility ?
Nico8583 is offline   Reply With Quote
Old 7th December 2017, 11:11   #11  |  Link
jd17
Registered User
 
Join Date: Jun 2017
Posts: 54
I would never encode to x265 in 8bit.
Some months back, I made a few 8bit vs. 10bit encoding comparisons - same CRF and settings.
I admit, that was still using x265 2.3 and things might have improved a bit since.

However, gradations were much, much better with 10bit encoding.
I always saw ugly banding in 8bit, even down to CRF13 and even with --tune grain.

I did only compare with the medium preset though - things might be better for 8bit with slow, slower, veryslow...
jd17 is offline   Reply With Quote
Old 7th December 2017, 15:25   #12  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,395
Quote:
Originally Posted by Nico8583 View Post
Thank you for this information.
So 10bit is more efficient but you don't recommend to use it for more compatibility ?
I think 10bit has less of a quality impact in HEVC than it does in H.264.

I'd suggest using 10-bit when its known all target devices support it. But that's not a safe assumption outside of Smart TVs.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Instant Video

My Compression Book

Amazon Instant Video is hiring! PM me if you're interested.
benwaggoner is offline   Reply With Quote
Old 11th December 2017, 22:31   #13  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you, I'll try both.
I've used a simple commandline : x265-8b.exe Video.avs --preset medium --keyint 240 --crf 20 --output Video.hevc
I get an error message : x265 [error]: yuv: width, height, and FPS must be specified
The same commandline with x264.exe works very well : x264.exe Video.avs --preset slow --keyint 240 --crf 22 --output Video.264
x265 doesn't include a decoder ? How can I use Avisynth script as input ?
Thank you !
Nico8583 is offline   Reply With Quote
Old 11th December 2017, 23:01   #14  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,671
Official x265 cli does indeed not directly support AviSynth input. You can use e.g. avs2pipemod:
avs2pipemod.exe -y4mp "input.avs" | x265.exe - --y4m -o "output.265"
sneaker_ger is offline   Reply With Quote
Old 12th December 2017, 00:12   #15  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you ! With avs2pipemod.exe, is it necessary to install Avisynth or is it "include" with the exe ?
Nico8583 is offline   Reply With Quote
Old 12th December 2017, 00:14   #16  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,671
You still need to have AviSynth installed. Not included.
sneaker_ger is offline   Reply With Quote
Old 12th December 2017, 00:20   #17  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
Thank you very much, I was using avs2yuv but it doesn't work with 64 bit DLL plugin. With avs2pipemod, there is a 32 and 64 bit version.
Nico8583 is offline   Reply With Quote
Old 12th December 2017, 00:26   #18  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 660
A last question : is it possible to use 2pass encoding with CRF ? If yes, is it a good choice to do a slow-firstpass then a second pass ? Or is it better to increase the preset (from medium to slow) ?
Thank you.
Nico8583 is offline   Reply With Quote
Old 12th December 2017, 00:38   #19  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,671
Quote:
Originally Posted by Nico8583 View Post
A last question : is it possible to use 2pass encoding with CRF ?
Yes.

Quote:
Originally Posted by Nico8583 View Post
If yes, is it a good choice to do a slow-firstpass then a second pass ? Or is it better to increase the preset (from medium to slow) ?
I'm inclined to say single pass CRF with higher preset is best use of cpu time.
sneaker_ger is offline   Reply With Quote
Old 12th December 2017, 09:23   #20  |  Link
jd17
Registered User
 
Join Date: Jun 2017
Posts: 54
I did not know that is possible.
However, what would be the benefit?

Isn't one of the reasons to use a CRF instead of a bitrate target to be freed from any bitrate constraints?

I thought CRF uses whatever bitrate necessary for each moment to achieve a certain degree of quality...
If CRF uses whatever is needed - what difference would a 2pass encode even make?
jd17 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.