Log in

View Full Version : x265 HEVC Encoder


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 [147] 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197

benwaggoner
3rd January 2020, 21:19
Oddly, enabling ssim-rd by itself will disable psy-rd, but if you manually specify both they'll both be used.
Have you confirmed they are both operating, or is it possible one overrides the other?

If psy-rd + ssim-rd looks different than just psy-rd OR ssim-rd, than they are doing something together. But it wouldn't be surprising if different rd modes can't operate simultaneously. Although, algorithmically, I could see these being able to function simultaneously.

Greenhorn
4th January 2020, 08:07
Have you confirmed they are both operating, or is it possible one overrides the other?

If psy-rd + ssim-rd looks different than just psy-rd OR ssim-rd, than they are doing something together. But it wouldn't be surprising if different rd modes can't operate simultaneously. Although, algorithmically, I could see these being able to function simultaneously.

That was an embarrasing mistake on my part. While the x265 CLI output will imply that both psy-rd and ssim-rd are enabled if you specify psy-rd after ssim-rd, it produces bit-identical output to not having ssim-rd enabled.

Similarly, enabling ssim-rd without doing anything to psy-rd is identical to manually disabling psy-rd. The encoder is clear about this, though, so hopefully I didn't manage to confuse anyone reading about that.

jlpsvk
6th January 2020, 17:26
what's better? ssim-rd or psy-rd?

microchip8
6th January 2020, 17:32
what's better? ssim-rd or psy-rd?

psy-rd... again, from my own testing ssim-rd produces visual distortions in some samples I tested long ago. ssim-rd is optimized to get the best SSIM metric values. While SSIM is (much) better than PSNR, it isn't perfect. psy-rd biases towards the energy of the source and will give, at higher values, a more subjectively looking better quality

There's also dynamic-rd but it needs vbv-bufsize and vbv-maxrate *and* you need to be hitting those for dynamic-rd to optimally do its thing

benwaggoner
6th January 2020, 23:05
There's also dynamic-rd but it needs vbv-bufsize and vbv-maxrate *and* you need to be hitting those for dynamic-rd to optimally do its thing
--dynamic-rd is really a speed/quality tradeoff option, orthogonal to the style of RD actually being applied. dynamic-rd changes the --rd parameter when the VBV buffer is hit, so a faster, lower quality setting can be used for easier sections of the video.

benwaggoner
7th January 2020, 00:18
Say, is anyone making Windows binaries with AVX-512 support somewhere? I wanted to do some tests.

jlpsvk
7th January 2020, 01:06
Say, is anyone making Windows binaries with AVX-512 support somewhere? I wanted to do some tests.

just use --asm avx512

:)

Magik Mark
7th January 2020, 02:24
--dynamic-rd is really a speed/quality tradeoff option, orthogonal to the style of RD actually being applied. dynamic-rd changes the --rd parameter when the VBV buffer is hit, so a faster, lower quality setting can be used for easier sections of the video.



What values would you suggest for vbv buffer when encoding 1080p and 2160p in 2 pass. Maybe a guide or a table. Thanks alot


Sent from my iPhone using Tapatalk

Blue_MiSfit
7th January 2020, 04:36
If you're encoding for streaming, I'd start with maxrate = 1.1x - 1.5x bitrate and bufsize = 2x bitrate.

Else set them to the profile maximums

Magik Mark
7th January 2020, 05:12
If you're encoding for streaming, I'd start with maxrate = 1.1x - 1.5x bitrate and bufsize = 2x bitrate.

Else set them to the profile maximums



Oh I see. Can you refer me to the table detailing max buffer for every profile? Thanks


Sent from my iPhone using Tapatalk

l00t
7th January 2020, 08:33
Say, is anyone making Windows binaries with AVX-512 support somewhere? I wanted to do some tests.

Unfortunately, according to my experiences, it won't do any good, because the CPU's clock speed will be significantly lower and will compensate the speed boost from using AVX512 (or at least this was the case for a Xeon Gold 6152).

jlpsvk
7th January 2020, 09:17
Unfortunately, according to my experiences, it won't do any good, because the CPU's clock speed will be significantly lower and will compensate the speed boost from using AVX512 (or at least this was the case for a Xeon Gold 6152).

yeah... avx512 produces much more heat... :( so probably safety issue...

LazyNcoder
7th January 2020, 14:35
Hello guys,

Any good, accurate and easy way to convert h265 HDR bt2020 to SDR bt709 using Avisynth/Vapoursynth (maybe via Staxrip)?
Something like what madVR is doing, without all the troubles.

redbtn
7th January 2020, 15:30
Hello guys,

Any good, accurate and easy way to convert h265 HDR bt2020 to SDR bt709 using Avisynth/Vapoursynth (maybe via Staxrip)?
Something like what madVR is doing, without all the troubles.Easy, no. You can try HDR to SDR conversion, but you have to adjust settings to every movie.

LazyNcoder
7th January 2020, 16:05
Easy, no. You can try HDR to SDR conversion, but you have to adjust settings to every movie.

Eh, thanks?

Any tutorials/tools for doing that?
I can search I know. But you could save a lot of time being wasted for me or other people reading your reply. After all, that's why we are all here. Thank you

redbtn
7th January 2020, 19:00
Any tutorials/tools for doing that?
I don't have any tutorials, but some links can help you.

http://forum.doom9.org/showthread.php?p=1847425

http://forum.doom9.org/showthread.php?p=1888974

http://forum.doom9.org/showthread.php?p=1880345

http://forum.doom9.org/showthread.php?p=1800667

Atak_Snajpera
7th January 2020, 19:16
Hello guys,

Any good, accurate and easy way to convert h265 HDR bt2020 to SDR bt709 using Avisynth/Vapoursynth (maybe via Staxrip)?
Something like what madVR is doing, without all the troubles.

https://forum.doom9.org/showthread.php?p=1893684#post1893684

Majorlag
7th January 2020, 21:13
Oh I see. Can you refer me to the table detailing max buffer for every profile? Thanks


Sent from my iPhone using Tapatalk

For x264 look at https://en.wikipedia.org/wiki/Advanced_Video_Coding under Levels

For x265 look at https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding or for a more detailed deep dive at https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding_tiers_and_levels

For my encodes I use 1080p:--vbv-bufsize 20000 --vbv-maxrate 20000 and for 2160p:--vbv-bufsize 25000 --vbv-maxrate 25000, so that I make sure to meet DXVA requirements for some older finicky set top boxes.

benwaggoner
7th January 2020, 22:25
What values would you suggest for vbv buffer when encoding 1080p and 2160p in 2 pass. Maybe a guide or a table. Thanks alot


Sent from my iPhone using TapatalkBy default I'll use the maximum values defined by the Profile, Tier, and Level. Wikipedia's HEVC article has a very nice table.

Sent from my SM-T837V using Tapatalk

benwaggoner
7th January 2020, 22:29
Hello guys,

Any good, accurate and easy way to convert h265 HDR bt2020 to SDR bt709 using Avisynth/Vapoursynth (maybe via Staxrip)?
Something like what madVR is doing, without all the troubles.There is no "accurate" way to do this. HDR and SDR masters are actually done as seperate creative passes, emphasizing different visual elements. They get approved seperately by the creatives before release.

If you want 709, best to start with the 709 source. There is almost no HDR content that isn't also available in SDR.

Sent from my SM-T837V using Tapatalk

benwaggoner
7th January 2020, 22:35
yeah... avx512 produces much more heat... :( so probably safety issue...This was also true of the initial AVX2 implementation, but the more recent ones get much better. I hope we'll see much more perfomant AVX-512 in the next-gen Xeon.

Still, MCW claims that performance gains can be found with it at slower presets at 4K, and I've got some test 8K samples to check.

Sent from my SM-T837V using Tapatalk

Atak_Snajpera
7th January 2020, 22:39
This was also true of the initial AVX2 implementation, but the more recent ones get much better. I hope we'll see much more perfomant AVX-512 in the next-gen Xeon.

Still, MCW claims that performance gains can be found with it at slower presets at 4K, and I've got some test 8K samples to check.

Sent from my SM-T837V using Tapatalk

Avx512 won't help xeons when AMD just Has epyc2/threadriper 3990x with 2x more cores ;)
Personally I prefer 2x more cores supporting avx-256 than 28 cores with avx-512.
Besides Intel Has created a huge mess with that extension.

https://pbs.twimg.com/media/DXSRqJXXUAE0s4J?format=jpg&name=small

nevcairiel
8th January 2020, 00:32
Besides Intel Has created a huge mess with that extension.

https://pbs.twimg.com/media/DXSRqJXXUAE0s4J?format=jpg&name=small

That "mess" looks far better if you remove the Knights Landing/Knights Mill stuff, which is only on Xeon Phi and of no relevance to something like x265 anyway - and Cannon Lake is dead, so could also remove that circle.

So what software currently does is develop against the Skylake-X subset (like x265 did), or the Icelake subset if they want to use more advanced features in the future. Two levels to care about, really. Before AVX512, we also had a number of small additional sets to augment SSE and AVX, but those get rarely talked about, since many of them arrived with AVX(2) at the same time. There were FMA3 and FMA4 of course (one for Intel, one for AMD, although AMD switched over in later CPUs), BMI1 and BMI2, XOP, and probably more that are of no direct video relevance that I forgot.

benwaggoner
8th January 2020, 00:49
Avx512 won't help xeons when AMD just Has epyc2/threadriper 3990x with 2x more cores ;)
Personally I prefer 2x more cores supporting avx-256 than 28 cores with avx-512.

I'm testing on the hardware I have, which is basically a c5.18xlarge.

benwaggoner
8th January 2020, 02:50
I'm testing on the hardware I have, which is basically a c5.18xlarge.
Anyhoo, I encoded 2400 frames of some 8K source with preset slower with and without AVX512.

Just one test run, but I got 1.41 fps with AVX512 and 1.38 without. Also, my office got warm :sly:.

Blue_MiSfit
8th January 2020, 08:37
Oh I see. Can you refer me to the table detailing max buffer for every profile? Thanks


Sent from my iPhone using Tapatalk

https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding_tiers_and_levels

estir
8th January 2020, 13:52
While SSIM is (much) better than PSNR, it isn't perfect.

It's not much better. it's not even always better than PSNR.
Anyway PSNRHVS is better than both of them (better even than MS-SSIM), but for some reason no modern codec uses it for RDO.

filler56789
10th January 2020, 04:40
x265.exe 3.2+29-c5ff729 has arrived.

http://msystem.waw.pl/x265/

Barough
10th January 2020, 14:51
x265 v3.2+31-6b348d5b56d8 (https://www.mediafire.com/file/xqehtwj1ipbhief/x265-3.2+31-6b348d5b56d8_Win_GCC920.7z/file) (32 & 64-bit 8/10/12bit Multilib Windows Binaries) (GCC 9.2.0)
https://bitbucket.org/multicoreware/x265/commits/branch/default

l00t
10th January 2020, 20:17
yeah... avx512 produces much more heat... :( so probably safety issue...

But why? The CPU is at 60oC at 100%, it should allow higher clocks...

redbtn
10th January 2020, 22:56
Umm, hdr-opt replaced to hdr10-opt. Is it mean that hdr-opt does nothing in previous releases?

microchip8
10th January 2020, 23:06
Umm, hdr-opt replaced to hdr10-opt. Is it mean that hdr-opt does nothing in previous releases?

No, it got replaced to make it more clear that it's meant for HDR10 content

redbtn
11th January 2020, 00:50
No, it got replaced to make it more clear that it's meant for HDR10 contentYeah, I mean it does nothing for hrd content. I used it for a year, thinking it doing optimization for HDR.

microchip8
11th January 2020, 05:56
Yeah, I mean it does nothing for hrd content. I used it for a year, thinking it doing optimization for HDR.

How do you know?

iwod
11th January 2020, 11:14
I am wondering if x265 has any plans for VVC / H.266? We are may be 6 months away from it being finalised.

redbtn
11th January 2020, 11:26
How do you know?

This patch deprecates the existing option '--hdr-opt' as the name sounds generic
even though the feature does QP optimizations only for HDR10 content
So i guess for HDR it doesn't nothing.

nevcairiel
11th January 2020, 11:47
So i guess for HDR it doesn't nothing.

"HDR" by itself means nothing. Its a marketing name, and does not describe any sort of specific video format for which one could optimize for.

What kind of HDR? HDR10/PQ? HLG? DV?

Thats why the name of the option was changed. HDR by itself is a category of formats, not any specific format one could apply any optimizations for.

Boulder
11th January 2020, 12:59
As far as I know, --hdr-opt simply did/does some adjustments to the encoding parameters. You could apply it to SDR content if you like. Not that it would be useful though..

benwaggoner
13th January 2020, 20:48
As far as I know, --hdr-opt simply did/does some adjustments to the encoding parameters. You could apply it to SDR content if you like. Not that it would be useful though..
It would be counterproductive in fact. IIRC, hdr10-opt adjusts delta qp for chroma based on luma levels to better match the characteristics of the PQ EOTF. By default x265 is more optimized for gamma. hdr10-opt would thus be bad for 709 or HLG. Dolby Vision, except in profiles that have a backwards compatible PQ base layer, doesn't even use Y'Cb'Cr, and in Profile 5 does some crazy dynamic range adjustments, so not helpful there.

There's probably fruitful research to be done for how to adapt chroma qp relative to luma based on each macroblock's luma levels in a psychovisual model.

utack
13th January 2020, 23:07
I am surprised how much difference "slower" makes compared to "slow"
It is probably expected due to all the extra bframes giving a quality gain and much more lookahead making different choices what to prioritize, but was not fully aware of it before testing.

Barough
14th January 2020, 18:36
x265 v3.2+34-8e6db24c1517 (https://www.mediafire.com/file/m9c8l1z59z1t2zr/x265-3.2+34-8e6db24c1517_Win_GCC920.7z/file) (32 & 64-bit 8/10/12bit Multilib Windows Binaries) (GCC 9.2.0)
https://bitbucket.org/multicoreware/x265/commits/branch/default

benwaggoner
14th January 2020, 22:21
I am surprised how much difference "slower" makes compared to "slow"
It is probably expected due to all the extra bframes giving a quality gain and much more lookahead making different choices what to prioritize, but was not fully aware of it before testing.
I've kinda thought of slower as the first "real" x265 preset, where most of the stuff that makes HEVC better are in play. The quality gap between slower and placebo is smaller than that between slow and slower.

Except for lossless, where placebo has a pretty significant efficiency gain over even veryslow.

Blue_MiSfit
15th January 2020, 06:22
I'd say "Slow" is a good compromise, but yeah, "Slower" is really where all the magic happens :)

Magik Mark
15th January 2020, 14:35
I have 16 threads CPU. Is there a way to instruct x265 to use only 14?

Need the rest for other apps

Atak_Snajpera
15th January 2020, 15:36
I have 16 threads CPU. Is there a way to instruct x265 to use only 14?

Need the rest for other apps

I would just run x265.exe in IDLE priority. You may also use Process Explorer to change affinity to only 14 logical processors.

vpupkind
15th January 2020, 18:03
It would be counterproductive in fact. IIRC, hdr10-opt adjusts delta qp for chroma based on luma levels to better match the characteristics of the PQ EOTF. By default x265 is more optimized for gamma. hdr10-opt would thus be bad for 709 or HLG. Dolby Vision, except in profiles that have a backwards compatible PQ base layer, doesn't even use Y'Cb'Cr, and in Profile 5 does some crazy dynamic range adjustments, so not helpful there.

There's probably fruitful research to be done for how to adapt chroma qp relative to luma based on each macroblock's luma levels in a psychovisual model.
ISO/IEC 23008-14 does that. I haven't had too much luck with their recommendations -- they destroyed textures in very bright scenes (think icy mountains).

benwaggoner
15th January 2020, 23:55
I have 16 threads CPU. Is there a way to instruct x265 to use only 14?
--pools "14" should exactly limit it to 14 cores.

https://x265.readthedocs.io/en/default/threading.html#thread-pools

Rousseau
16th January 2020, 07:15
x265 v3.2+34-8e6db24c1517 (https://www.mediafire.com/file/m9c8l1z59z1t2zr/x265-3.2+34-8e6db24c1517_Win_GCC920.7z/file) (32 & 64-bit 8/10/12bit Multilib Windows Binaries) (GCC 9.2.0)
https://bitbucket.org/multicoreware/x265/commits/branch/default


multi-pass-opt-analysis / distortion causes a crash in this build.

Magik Mark
16th January 2020, 11:21
--pools "14" should exactly limit it to 14 cores.



https://x265.readthedocs.io/en/default/threading.html#thread-pools



Thanks alot!


Sent from my iPhone using Tapatalk

jlpsvk
16th January 2020, 23:54
Is there any way to fully utitlise x265 with single process (without distrubuted encoding) on Ryzen 9 3950X (16c/32t) without quality loss? :)