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 7th March 2022, 17:46   #161  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,824
Would folks be interested in my providing a 10-bit SDR of Tears of Steel for testing? 10-bit support is mandatory for AV1 and nigh universal for HEVC now.

And for HDR testing, is there a preference between 1080p or 2160p? 1080p is faster to encode and easier to compare, but most HDR is also UHD so that's the primary use case?

I was thinking of using Sol Levante for HDR, but it has some uniquely challenging to encode sequences I've not been able to make look good at 15 Mbps 1080p with the encoders I've tried. Good as a stress test, but not good as a representative example.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 8th March 2022, 08:09   #162  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
Quote:
Originally Posted by benwaggoner View Post
Would folks be interested in my providing a 10-bit SDR of Tears of Steel for testing? 10-bit support is mandatory for AV1 and nigh universal for HEVC now.
For your encoding challenge ?

I don't think that for ToS 8 or 10 bit makes a real difference as an encoder can only produce, I take a very rough estimate here, 6.5 bits precision on average at these low bitrates.

Might be interesting academically though.
rwill is offline   Reply With Quote
Old 4th May 2022, 08:10   #163  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
Quote:
Originally Posted by jcj View Post
--psy-rdoq 50
Doesn't that create LOTS of noise?!
Forteen88 is offline   Reply With Quote
Old 4th May 2022, 19:13   #164  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,824
Quote:
Originally Posted by rwill View Post
For your encoding challenge ?

I don't think that for ToS 8 or 10 bit makes a real difference as an encoder can only produce, I take a very rough estimate here, 6.5 bits precision on average at these low bitrates.
I'm not sure if you're measuring "bits of precision" in a relevant way. Certainly the encode will have output with smooth histograms over the 8- and 10-bit ranges. Frequency domain and raster precision have quite different visual impact.

Extra input precision means less dithering is required, and thus less extra noise.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 4th May 2022, 20:22   #165  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
Quote:
Originally Posted by benwaggoner View Post
I'm not sure if you're measuring "bits of precision" in a relevant way. Certainly the encode will have output with smooth histograms over the 8- and 10-bit ranges. Frequency domain and raster precision have quite different visual impact.

Extra input precision means less dithering is required, and thus less extra noise.
I mean something like SNR. Thats why I wrote 'very rough estimate'.

The higher the quantization the less important the bit depth and associated dithering becomes. I mean if dithering is quantized away anyway its only purpose is to generate some sort of local higher precision for low frequency components to avoid banding, blocking and sorts. So my guess is that it does not matter if the input is 8 or 10 bit if a H.265 encoder is in QP >= 30 regions most of the time anyway.

I know some people are adding dithering/noise to encodes but am just unable to see any reason to use it with encodes where quantization is so high that it will not have a meaningful impact on the end result because the precision of the input is vastly higher than what can be reconstructed after a high quantization. We do have Deblocking Filters now...


@Forteen88

It will not create noise but one will most likely lose the coding efficiency benefits of RDOQ.
rwill is offline   Reply With Quote
Old 13th September 2022, 04:46   #166  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by benwaggoner View Post
Would folks be interested in my providing a 10-bit SDR of Tears of Steel for testing? 10-bit support is mandatory for AV1 and nigh universal for HEVC now.

And for HDR testing, is there a preference between 1080p or 2160p? 1080p is faster to encode and easier to compare, but most HDR is also UHD so that's the primary use case?

I was thinking of using Sol Levante for HDR, but it has some uniquely challenging to encode sequences I've not been able to make look good at 15 Mbps 1080p with the encoders I've tried. Good as a stress test, but not good as a representative example.
I'd love to see Tears of Steel at 4K with HDR, that would be cool. I've been trying to find one with 4K and 5.1 audio, but I can't find that. What's the best encode done so far?
Sol Levante is a good encoding test, are there any more lossless videos like that? Thats the first lossless file I've encoded and it looks excellent.

Last edited by HD MOVIE SOURCE; 13th September 2022 at 04:48.
HD MOVIE SOURCE is offline   Reply With Quote
Old 21st September 2022, 17:01   #167  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
When you're only dealing with 1 Mbps, is there any way to get scene cuts to look cleaner without turning into artifacts? That's my biggest issue with a restricted bit-rate. Does anyone have any advice?
HD MOVIE SOURCE is offline   Reply With Quote
Old 22nd September 2022, 00:50   #168  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,824
Quote:
Originally Posted by HD MOVIE SOURCE View Post
I'd love to see Tears of Steel at 4K with HDR, that would be cool. I've been trying to find one with 4K and 5.1 audio, but I can't find that. What's the best encode done so far?
Sol Levante is a good encoding test, are there any more lossless videos like that? Thats the first lossless file I've encoded and it looks excellent.
Tears of Steel was only made as 4K SDR, alas. I looked into remastering it for HDR a few years back. It was theoretically possible, but would require regrading all the camera footage and a lot of tweaking and rerendering of the CGI stuff to incorporate HDR elements.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 22nd September 2022, 00:52   #169  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,824
Quote:
Originally Posted by HD MOVIE SOURCE View Post
When you're only dealing with 1 Mbps, is there any way to get scene cuts to look cleaner without turning into artifacts? That's my biggest issue with a restricted bit-rate. Does anyone have any advice?
Can you share your command line?

There's a lot of tweaks in x265 that can be done.
  • Bigger gap between --keyint and --min-keyint
  • Reduce --ipratio
  • Increase --rc-lookahead (max is --keyint)
  • Use --open-gop
  • Play around with the 3.x scenecut features.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 24th September 2022, 05:24   #170  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by benwaggoner View Post
Can you share your command line?

There's a lot of tweaks in x265 that can be done.
  • Bigger gap between --keyint and --min-keyint
  • Reduce --ipratio
  • Increase --rc-lookahead (max is --keyint)
  • Use --open-gop
  • Play around with the 3.x scenecut features.
Im using uhd-bd=1 and keyint of 24. The reason for that is I always want to see the restrictions of encoding with 4K discs. I completely understand it's not optimal for this challenge.

This is what I use for my normal encodes using a constant rate factor of 0 with maxrate and buffsize control. Using these settings when lowering the maxrate and buffsize to 1 is pretty tough. I don't mind that it looks bad, I just want to see if there's anything that would make scene cuts look better.

Slow speed.

uhd-bd=1:no-open-gop:total-frames=0:min-keyint=1:keyint=24:rc-lookahead=24:lookahead-slices=0:vbv-maxrate=98000:vbv-bufsize=99000:ref=5:subme=7:aq-mode=3:aq-strength=1.6:bframes=3:b-adapt=0:ipratio=1.00bratio=1.00:no-deblock:no-sao:no-strong-intra-smoothingsy-rd=0.00sy-rdoq=0.00:rdoq-level=0:no-cutree

I set vbv-maxrate=98000:vbv-bufsize=99000 to vbv-maxrate=1000:vbv-bufsize=1000

I really just did it to see what it would look like under 4K BD restrictions and the restricted bit-rates. I did notice though you use a buff size of around 4000, are we aloud to do that?

Last edited by HD MOVIE SOURCE; 24th September 2022 at 05:27.
HD MOVIE SOURCE is offline   Reply With Quote
Old 24th September 2022, 12:22   #171  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
Quote:
This is what I use for my normal encodes using a constant rate factor of 0 with maxrate and buffsize control. Using these settings when lowering the maxrate and buffsize to 1 is pretty tough. I don't mind that it looks bad, I just want to see if there's anything that would make scene cuts look better.
...
I did notice though you use a buff size of around 4000, are we aloud to do that?
Quote:
Tears of Steel
1.0, 1.5, and 2.0 Mbps ABR
4 Mbps peak bitrate
12 Mbps VBV
Max 5 sec (120 frame) GOP
No preprocessing
What you are doing is more or less running constant rate (CBR) with 1 second buffer and 1 second keyint. No wonder everything looks like crap.
rwill is offline   Reply With Quote
Old 25th September 2022, 18:07   #172  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by rwill View Post
What you are doing is more or less running constant rate (CBR) with 1 second buffer and 1 second keyint. No wonder everything looks like crap.
Ah, I see now, thanks for pointing that out. I will take a 2nd attempt and see. With that said, apart from keyint settings, are there any settings that can help with a scenecut even if I continue to use 1-second keyint?
HD MOVIE SOURCE is offline   Reply With Quote
Old 25th September 2022, 18:32   #173  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
Quote:
Originally Posted by HD MOVIE SOURCE View Post
Ah, I see now, thanks for pointing that out. I will take a 2nd attempt and see. With that said, apart from keyint settings, are there any settings that can help with a scenecut even if I continue to use 1-second keyint?
Well, the keyframes have to fit into the VBV buffer which is re-filled at maxrate. Their bits are taken from the global bit-budget. I don't know really. Higher VBV maxrate would help maybe to make space in the buffer but everything is gonna be bit-starved anyway.
rwill is offline   Reply With Quote
Old 25th September 2022, 20:29   #174  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by rwill View Post
Well, the keyframes have to fit into the VBV buffer which is re-filled at maxrate. Their bits are taken from the global bit-budget. I don't know really. Higher VBV maxrate would help maybe to make space in the buffer but everything is gonna be bit-starved anyway.
Okay, interesting, I realized I don't really know how the maxrate and buffer really work. So basically if though you're targeting 1 Mbps, you can allow for higher maxrates so that when scene cutting, you have more bits right?

Just wondering though, let's say I set my maxrate to 4Mbps, and set the buffer to 100Mbps, what does that actually do? I'm just trying to picture the interaction.
HD MOVIE SOURCE is offline   Reply With Quote
Old 25th September 2022, 20:45   #175  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
https://forum.doom9.org/showthread.p...19#post1953919

Your "buckets" will be 100Mbit and will empty/fill with 4Mbit.
rwill is offline   Reply With Quote
Old 26th September 2022, 04:16   #176  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Quote:
Originally Posted by rwill View Post
https://forum.doom9.org/showthread.p...19#post1953919

Your "buckets" will be 100Mbit and will empty/fill with 4Mbit.
So the buffer would just be ahead of the maxrate by 100 Mbps? and the max rate will continuously take 4Mbps out of the buffer?

In that post you linked, some talked about underflow, what, and how I test for it? Somebody responded and said to check how it decodes or something. So, is there something I can do to test whether my maxrate and buffer settings work correctly?

I noticed that the buffer rate is 12 Mbps, and the maxrate is 4 Mbps, is this 3x difference typical? Would this help with scenecuts, but having more stored buffer?

Thanks.
HD MOVIE SOURCE is offline   Reply With Quote
Old 26th September 2022, 05:50   #177  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Location: Berlin, Germany
Posts: 378
https://en.wikipedia.org/wiki/Video_buffering_verifier

Have you read this and the respective links to CBR and VBR yet? It explains most basic bit allocation and the pros and cons.
rwill is offline   Reply With Quote
Old 26th September 2022, 12:18   #178  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 332
Quote:
I noticed that the buffer rate is 12 Mbps, and the maxrate is 4 Mbps, is this 3x difference typical? Would this help with scenecuts, but having more stored buffer?

Thanks.
I think its set to 12 in the original post cause that is max bitrate for level 4 main tier (i.e. most devices capable of decoding the stream should have a big enough buffer to handle the stream). The most common values i've seen is either set it based on the level or 1-2x maxrate.

Think about it this way, you use maxrate to specifiy the maximum read speed of your target decoder; so if you use 4Mbps a 5Mbps client connection will be able to stream that without issue (audio and headroom needs to be taken in account as well). This is one of reason why physical media (e.g. bluray) uses lower VBV limits than what the video standard allows for, cause the the relative slow read speeds of the optical discs. And by setting a higher buffsize than your maxrate you allow for sections with higher bitrate cause data has accumulated in the buffer, and the vbv modell ensures that as long as you can feed data to the decoder of the speed of the maxrate you wont underflow (i.e. the decoder runs out of data). This can be very beneficial for streaming were you need to set rather constrained maxrate vaules.

And btw, why are you using no-strong-intra-smoothing? It will only result in more blocking and banding, and especially at this bitrate it will not improve image quality at all. Even at high bitrates I havnt seen any positive effects of disabling this feature.

And also, I'm not sure why you are so fixated on the UHD-Bluray specifications, if you are not authoring for a physical disc, those requirements becomes rather irrelevant. Why even go to the lengths were you try to mix that with low-bandwith-streaming? There are no magic in those requirements, and most of the specifics are actually restrictions that will hurt quality.

Last edited by excellentswordfight; 27th September 2022 at 13:09.
excellentswordfight is offline   Reply With Quote
Old 26th September 2022, 20:59   #179  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,824
Quote:
Originally Posted by excellentswordfight View Post
I think its set to 12 in the original post cause that is max bitrate for level 4 main tier (i.e. most devices capable of decoding the stream should have a big enough buffer to handle the stream). The most common values i've seen is either set it based on the level or 1-2x maxrate.
Yep, that's exactly where I got 12 Mbps. It was the most restrictive for the minimum compatible Profile @ Level (generally 4.0) for codecs relevant to the test.

Quote:
And also, I'm not sure why you are so fixated on the UHD-Bluray specifications, if you are not authoring for a physical disc, those requirements becomes rather irrelevant. Why even go to the lengths were you try to mix that with low-bandwith-streaming? There are no magic in those requirements, and most of the specifics are actually restrictions that will hurt quality.
Yeah, I didn't have any optical disc scenario in mind when I came up with the test in the first place. That said, comparing best-effort to best-effort with optical disc constraints is an interesting way to demo the hit on compression efficiency due to Blu-ray requirements. I see a lot of AVSForum folks assuming that streaming has to be bad because Blu-ray bitrates go so much higher. But Bl8-ray NEEDS higher bitrates to get the same quality than streaming does. An IDR every 24 frames minimum is some serious overhead!
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 12th October 2022, 05:48   #180  |  Link
HD MOVIE SOURCE
Registered User
 
HD MOVIE SOURCE's Avatar
 
Join Date: Mar 2021
Location: North Carolina
Posts: 138
Yeah, I'm honestly just seeing how certain restrictions like bit-rate, and even a uhd-bd=1 effect quality. I just like to test things and see if there's neat workarounds to improve quality even under certain restrictions.

Its my first time encoding at a lower-than-normal bit-rate, so I'm seeing what I can get away with and what I cannot. Changing the bufsize and maxrate has really helped, as I am trying this with CRF instead on 2-pass average bit-rate. Again, I'm seeing how the bit-rate constraints impact the CRF.

I see that intra-smoothing and deblock absolutely play a huge impact with bit-rates this low.

I gues the biggest thing here is keeping the bit-rate low, but having enough buffer than upon a scenecut, there's enough buffer to give that scenecut enough bits so artifacts are kept at bay. This is definitely something that Physical Media has issues with and can be improved with streaming because of the one second buffer on discs.
When it comes to encoding like this as though its for ststreaming, you mayas well use 250 or is it 260 keyint right to reduce the impact even on iframes right? I downloaded Ben's encodes and they look very good for having a 1 Mbps target bit-rate. I actually didn't think it was possible to get video this acceptable with bit-rates that low.
HD MOVIE SOURCE 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 19:22.


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