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)

View Poll Results: For the size, do you find the encoded output acceptable?
Yes 0 0%
No 4 66.67%
Other (please specify) 2 33.33%
Voters: 6. You may not vote on this poll

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th July 2021, 05:48   #1  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Options to improve quality on this encode (without huge increase in time)?

If you vote in the poll, please put why you don't find the output acceptable. Votes are great, but no explanation doesn't help anyone understand your view.

I've chuffed Charmed has been released with the original music on Blu-ray, but as you can imagine, eight seasons of per-episode remuxes takes up quite a lot of space. It doesn't appear too grainy most of the time so thought it would be a good contender for x265.

Whilst I would love an 8, 16, or 32-core CPU, it's not realistic. I'm using a 4C/4T Xeon (Skylake). Since there are so many episodes to encode, I'm trying to find a reasonable middle ground of quality:size:time. I have used nr-inter 150 in order to keep most detail, but reduce noise just a little bit as this seems to produce good results in terms of size:quality (and did with x264). Please bear this in mind as it's noticeable in most screenshots, but not to an extent that it removes all details (in my opinion).

I'm looking for advice on what else I could do, but without massively increasing the time and size, to increase perceived quality. I'm happy with the size, but don't mind trying CRF19 (don't see much of a need from watching the encoded episode) and 90 minutes per encode is already slightly higher than I would like (I believe it's ~180 episodes).

Quote:
x265:
Preset: Medium
Tune: None
Format/Info: High Efficiency Video Coding
Format profile: Main 10@L4@Main
Duration: 44 min 21 s
Bit rate: 4 334 kb/s
Frame rate: 23.976 (24000/1001) FPS
Stream size: 1.34 GiB (94%)
Writing library: x265 3.5+9+14-6c69ed37d:[Windows][GCC 10.2.0][64 bit] 10bit

Changed from the preset:

--crf 20 --output-depth 10 --profile main10 --psy-rd 2.15 --rdoq-level 1 --psy-rdoq 1.75 --rskip 2 --rskip-edge-threshold 3 --nr-inter 150 --ipratio 1.35 --pbratio 1.25 --weightb --bframes 6 --rc-lookahead 25 --ref 4 --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -3:-3 --no-sao --
Quote:
Time Taken: 90m (acceptable)
Blu-ray Source (Left) - x265 output (Right). The most interesting comparison, in my opinion, is the final one. It seems that scene has issues compared to the rest.


















Last edited by tonemapped; 5th August 2021 at 03:36.
tonemapped is offline   Reply With Quote
Old 27th July 2021, 10:07   #2  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Just an idea since you are looking for better performance - have you tested downscaling to 720p? I am quite sure the difference would be unnoticable upon playback, encoding much faster and requires less diskspace. Using something like BicubicResize(1280, 720, b=-0.5, c=0.25) or BicubicResize(1280, 720, b=-0.6, c=0.3) could well do the trick. If you encode at 720p, drop CTU to 32. It's also possible that you could switch to a slower preset, or at least test --rd 6.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 27th July 2021, 11:15   #3  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Quote:
Originally Posted by Boulder View Post
Just an idea since you are looking for better performance - have you tested downscaling to 720p? I am quite sure the difference would be unnoticable upon playback, encoding much faster and requires less diskspace. Using something like BicubicResize(1280, 720, b=-0.5, c=0.25) or BicubicResize(1280, 720, b=-0.6, c=0.3) could well do the trick. If you encode at 720p, drop CTU to 32. It's also possible that you could switch to a slower preset, or at least test --rd 6.
Testing a 720p encode with BlackmanResize. Also testing (out of curiosity as it was a lazy way I did some encodes with only 2C/2T in 2011 - provided better results - to my eyes - than 720p with only slightly longer times) 1440x1080.
tonemapped is offline   Reply With Quote
Old 27th July 2021, 12:47   #4  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
You should test those BicubicResize ones as well. The trick is that it will keep detail and sharpness very well when reupscaling upon playback, a well known Avisynth wizard named Didée once came up with the idea. Normally Bicubic is used with b=0, c=0.5 or 0.6.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 27th July 2021, 21:34   #5  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Quote:
Originally Posted by Boulder View Post
You should test those BicubicResize ones as well. The trick is that it will keep detail and sharpness very well when reupscaling upon playback, a well known Avisynth wizard named Didée once came up with the idea. Normally Bicubic is used with b=0, c=0.5 or 0.6.
Doing two more tests, one with the suggested BicubicResize(1280, 720, b=-0.6, c=0.3) and no nr-inter, and one with BicubicResize(1440, 808, b=-0.6, c=0.3) and no nr-inter. I know 1440x808 is an unorthodox resolution, but it's worked well before, as has 1440x1080 with DAR of (obviously) 1.777778.

The previous 720p test with nr-inter 75 and BlackmanResize at CRF 21 only took 57m, but is too small 730MB).
tonemapped is offline   Reply With Quote
Old 27th July 2021, 23:59   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
"Too small" is an unusual complaint in encoding .
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 28th July 2021, 02:06   #7  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Quote:
Originally Posted by benwaggoner View Post
"Too small" is an unusual complaint in encoding .
The output produced at the CRF was too small as I do have an approximate size target per episode (~1.5GB avg. using CRF). Perhaps that would have been a better way of putting it!
tonemapped is offline   Reply With Quote
Old 28th July 2021, 09:10   #8  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Why not do a 2-pass encode then? I find target sizes very dangerous unless you try to fill a DVD or something. Some sources compress really, really well, some require a lot of bits unless you DNR it to hell (which I won't). Also the aspect ratio matters, 1.78:1 has a lot more active pixels than 2.35:1. I always crop and resize accordingly since the existing black borders do contain garbage. It's not directly visible but can be seen for example when analyzing MVTools's vectors.

I use CRF 18 or 19 for 720p. Average bitrates are usually around 2-6 Mbps.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 28th July 2021, 13:04   #9  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Quote:
Originally Posted by Boulder View Post
Why not do a 2-pass encode then? I find target sizes very dangerous unless you try to fill a DVD or something. Some sources compress really, really well, some require a lot of bits unless you DNR it to hell (which I won't). Also the aspect ratio matters, 1.78:1 has a lot more active pixels than 2.35:1. I always crop and resize accordingly since the existing black borders do contain garbage. It's not directly visible but can be seen for example when analyzing MVTools's vectors.

I use CRF 18 or 19 for 720p. Average bitrates are usually around 2-6 Mbps.
Time is the main concern. With 8 seasons, that's a lot of episodes (otherwise I would do 3-pass encodes as I sometimes do with x264)

The test I've done with 1440x1080 with no noise NR looks great to my eyes. Obviously, there's always a difference between screenshots on a 4K Professional 10-bit display (the one I use) and my primary TV where I'm sitting about 3 metres away.
tonemapped is offline   Reply With Quote
Old 28th July 2021, 13:19   #10  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I think your time would be spent best if you settled to the resolution you are going to use and then find the CRF value which gives you transparency during playback. Then just encode the whole series with that and you'll save plenty of time and possible a lot of diskspace as well. That's what I've done - CRF 19 was the spot where I couldn't find any obvious faults from about 2 metres to the 65" TV. Then I just added some headroom but still use 19 if the source is very noisy and the bitrate would shoot through the roof. Going down to 720p was a no-brainer after comparisons and using Zopti to optimize the Bicubic downsizing parameters per encode (something I haven't proposed since time is an important factor for you).
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 28th July 2021, 17:18   #11  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by tonemapped View Post
The output produced at the CRF was too small as I do have an approximate size target per episode (~1.5GB avg. using CRF). Perhaps that would have been a better way of putting it!
If your files are coming out with file sizes below what you've budgeted, but meet your quality targets, that's Winning Compression!

Try the same settings at the full 1080p, and you'll probably land at about your target file size without having thrown away any data.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 29th July 2021, 02:00   #12  |  Link
RanmaCanada
Registered User
 
Join Date: May 2009
Posts: 328
I would have to agree with benwaggoner. If you are getting smaller file sizes and meeting or exceeding your quality targets, that is a total win.
RanmaCanada is offline   Reply With Quote
Old 29th July 2021, 03:08   #13  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Quote:
Originally Posted by RanmaCanada View Post
I would have to agree with benwaggoner. If you are getting smaller file sizes and meeting or exceeding your quality targets, that is a total win.
+2, This would have made Didée very happy.
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 29th July 2021, 07:33   #14  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
Why not download the series from the Internet, that is encoded with better x265-settings than this? Because if you already own the series, it shouldn't infringe on copyright laws, right?!
Disregard this comment if it is still illegal to downloaded it from the Internet.

Last edited by Forteen88; 31st July 2021 at 05:16.
Forteen88 is offline   Reply With Quote
Old 29th July 2021, 17:26   #15  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Forteen88 View Post
Why not download the series from the Internet, that is encoded with better x265-settings than this? Because if you already own the series, it shouldn't infringe on copyright laws, right?!
Disregard this comment if it is is still illegal to downloaded it from the Internet.
IANAL, but that is not a safe presumption to make without checking laws in any given jurisdiction.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 31st July 2021, 10:39   #16  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Quote:
Originally Posted by tonemapped View Post
Blu-ray Source (Left) - x265 output (Right). The most interesting comparison, in my opinion, is the final one. It seems that scene has issues compared to the rest.
Hm... I would first of all think on the meager --aq-strength.
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 31st July 2021, 20:07   #17  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
I've so far settled on (medium) --crf 18.5 --output-depth 10 --profile main10 --level-idc 4 --no-high-tier --psy-rd 2.15 --psy-rdoq 1.2 --rskip 2 --rskip-edge-threshold 3 --ctu 32 --dynamic-refine --nr-inter 150 --vbv-bufsize 12000 --vbv-maxrate 9000 --subme 4 --me umh --weightb --rc-lookahead 30 --deblock -3:-3 --no-sao --selective-sao 2.

Quote:
x265 [INFO]: frame I: 908, Avg QP:17.84 kb/s: 25345.65
x265 [INFO]: frame P: 15111, Avg QP:19.53 kb/s: 8447.17
x265 [INFO]: frame B: 47797, Avg QP:23.43 kb/s: 1473.92
x265 [INFO]: Weighted P-Frames: Y:10.7% UV:5.2%
x265 [INFO]: consecutive B-frames: 10.5% 2.5% 5.2% 41.6% 40.2%
encoded 63816 frames in 4612.85s (13.83 fps), 3464.77 kb/s, Avg QP:22.42
Resolution is 1440x1080 @ 1.777778. With Boulder's Bicubic suggestions above (modified) it looks great. The file size is 1.17GB/@3466 kbps and took 1h17m.

Without far higher bitrates than x264, it doesn't seem possible to produce realistic grain, and by that I mean grain that seems natural rather than oddly static in areas it's not in the source and isn't in x264 with a lower bitrate. A small nr of 150 seems to resolve that issue and, of course, produces a smaller file.

Based on the fairly clean source with grain in some areas, but with nr-inter 150 removing most of it (i.e. not 'complicated' or high grain), what changes would you make to the above? The encode seems as though it needs more bitrate. Maybe a higher qcomp would help. Reducing nr doesn't as it re-introduces the problem that even 10mbps doesn't solve (as mentioned above).

Screenshots (Spine36 -> 1920x1080). All b-frames.







tonemapped is offline   Reply With Quote
Old 1st August 2021, 11:27   #18  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
The girl has a defect in the left elbow, which looks like a white dot and stripe (the last scene)
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 1st August 2021, 13:47   #19  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Quote:
Originally Posted by Gravitator View Post
The girl has a defect in the left elbow, which looks like a white dot and stripe (the last scene)
Do you mean this image?
__________________
PC: R9 5900X | 32GB 3600 MT/s RAM | 2*1TB NVMe | RTX 3080 | water-cooled

NAS: SM 48-bay 240TB+ storage | Xeon 1220 | 32GB DDR4 ECC

HTPC: Pentium J5005 | 16GB RAM | 256GB SSD | 15W
tonemapped is offline   Reply With Quote
Old 1st August 2021, 14:31   #20  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Regarding the problems with red coloured frames, it's more or less a known issue. I think the encoder doesn't spend enough bits on them compared to other ones.

--crqpoffs and --cbqpoffs can be used to force some QP offsets. I personally use -3 for both, I think that is what x264 does internally.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder 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 22:43.


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