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 14th June 2021, 20:25   #8201  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by rwill View Post
What you can try is to pipe ffmpeg output into a file like so:

ffmpeg.exe -i %1 -pix_fmt yuv420p -f yuv4mpegpipe - > test.y4m

and then use test.y4m as an input file to a standalone x265.exe call to see what x265 does and debug that.
Yeah, I either output to .y4m or pipe into x265. It really simplifies debugging, and allows for specific x265 builds to be used.

Note that if you are doing 10-bit, you need to use:

ffmpeg.exe -i %1 -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - > test.y4m


And for piping:

ffmpeg.exe -i foo.mov -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - | x265.exe - --y4m
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th June 2021, 06:41   #8202  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
After painstakingly long denoising, I am finally ready to run the final x265-only process on The Fith Element (combined from 4x seperately denoised parts). I used the following command line:

Code:
VSPipe --y4m "f:\jobs\fifthfin.vpy" - | x265 --y4m --input - --preset medium --input-depth 10 --output-depth 10 --crf 10 --colorprim 9 --transfer 16 --colormatrix 9 --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50)" --max-cll "10000,724" --frames 181104 --chromaloc 2 --output "g:\video\fifthfin.hevc"
x265 outputs:

Quote:
[0.8%] 1483/181104 frames, 4.180 fps, 18984 kb/s, 145.92 MB, eta 11:56:15, est.size 17819 MB
Says around 19 Mb/s, and estimated file-size of ca. 18 G. Those values seem extremely low, especially considering the source was 45 G. I even set CRF to 10. But it still seems too low.

Am I doing anything wrong?
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 15th June 2021, 07:16   #8203  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Looks ok to me. The CRF value's behaviour in HDR and SDR differs quite a lot as the HDR input is very flat and the encoder does not do any internal grading when analysing the video. I usually lower the CRF value by 4 with HDR encodes to get to the similar quality level.
__________________
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 15th June 2021, 07:30   #8204  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by Boulder View Post
Looks ok to me. The CRF value's behaviour in HDR and SDR differs quite a lot as the HDR input is very flat and the encoder does not do any internal grading when analysing the video. I usually lower the CRF value by 4 with HDR encodes to get to the similar quality level.
Thx. So, should I even go to CRF = 6? Or should 10 suffice? Overall, I'm very impressed with the compression ratio of x265.
__________________
Gorgeous, delicious, deculture!

Last edited by asarian; 15th June 2021 at 07:33.
asarian is offline   Reply With Quote
Old 15th June 2021, 07:36   #8205  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 349
Quote:
Originally Posted by FranceBB View Post
My new baby arrived today.
I look forward to take it for a spin with x265 (*_*)

Intel Xeon Gold, 56c/112th with AVX-512 and this time is in a server room with freezing cold temperatures, so I dare AVX512 to make it hot! xD
Too low base frequency, too many cores.
rwill is offline   Reply With Quote
Old 15th June 2021, 08:07   #8206  |  Link
_kermit
Registered User
 
Join Date: Apr 2017
Posts: 63
Quote:
Originally Posted by benwaggoner View Post
Yeah, I either output to .y4m or pipe into x265. It really simplifies debugging, and allows for specific x265 builds to be used.

Note that if you are doing 10-bit, you need to use:

ffmpeg.exe -i %1 -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - > test.y4m


And for piping:

ffmpeg.exe -i foo.mov -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - | x265.exe - --y4m
thanks to both.

so, this would have been wrong?

ffmpeg.exe -i %1 -pix_fmt yuv420p -f yuv4mpegpipe -| x265.exe --input - --y4m ....

so I tried this:

ffmpeg.exe -i %1 -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - > %1.y4m
x265.exe --input %1.y4m --y4m ....

what I noticed:
- ffmpeg runs async in the background, continuously creating the file while x265 already starts processing.
- The file is huge, already 90GB out of a 20GB mkv

Is both expected and ok?
_kermit is offline   Reply With Quote
Old 15th June 2021, 08:43   #8207  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by asarian View Post
Thx. So, should I even go to CRF = 6? Or should 10 suffice? Overall, I'm very impressed with the compression ratio of x265.
I kind of would expect CRF 10 to look very good. Of course, it depends on your requirements and viewing distance so testing the results with different CRF in your real life viewing conditions is always recommended.

In addition to your settings, I'd set --no-sao to disable the infamous Smooth All Objects functionality. I'd probably also use --deblock -1:-1.
__________________
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 15th June 2021, 08:51   #8208  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by rwill View Post
Too low base frequency, too many cores.
Not really, I'm not an home user, I'm gonna be encoding professional UHD 12bit masterfiles coming from IMF Packages with MJPEG2000 RGB 12bit sources and I expect x265 to scale quite efficiently on all the cores. We'll see.
FranceBB is offline   Reply With Quote
Old 15th June 2021, 12:41   #8209  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 349
Quote:
Originally Posted by _kermit View Post
what I noticed:
- ffmpeg runs async in the background, continuously creating the file while x265 already starts processing.
- The file is huge, already 90GB out of a 20GB mkv

Is both expected and ok?
My intention was to check whether x265 would crash on the .y4m or complete. Because the input is the same as piped but pipe failed.

Regarding the size, you get ~6Mb per HD frame or ~24Mb per UHD frame. So at 24fps thats ~150 or ~600 Megabytes per second of video. So its not practical.
rwill is offline   Reply With Quote
Old 15th June 2021, 12:42   #8210  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
--ssim-rd - results in terribly poor image quality at low bitrate.
Code:
ffmpeg -i z:\space_6s.mkv -f yuv4mpegpipe - | x265 --y4m --input - --output-depth 10 --profile main10 --max-merge 1 --no-early-skip --rskip 0 --bframes 1 --ref 1 --bitrate 1000 --tune ssim --ssim-rd z:\ssim-rd.mkv
Code:
ffmpeg -i z:\space_6s.mkv -f yuv4mpegpipe - | x265 --y4m --input - --output-depth 10 --profile main10 --max-merge 1 --no-early-skip --rskip 0 --bframes 1 --ref 1 --bitrate 1000 --tune ssim z:\ssim-rd-off.mkv
Download an example > ssim-rd vs ssim-rd-off
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 15th June 2021, 13:34   #8211  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by Gravitator View Post
--ssim-rd - results in terribly poor image quality at low bitrate.
Code:
ffmpeg -i z:\space_6s.mkv -f yuv4mpegpipe - | x265 --y4m --input - --output-depth 10 --profile main10 --max-merge 1 --no-early-skip --rskip 0 --bframes 1 --ref 1 --bitrate 1000 --tune ssim --ssim-rd z:\ssim-rd.mkv
Code:
ffmpeg -i z:\space_6s.mkv -f yuv4mpegpipe - | x265 --y4m --input - --output-depth 10 --profile main10 --max-merge 1 --no-early-skip --rskip 0 --bframes 1 --ref 1 --bitrate 1000 --tune ssim z:\ssim-rd-off.mkv
Download an example > ssim-rd vs ssim-rd-off
Quote:
Originally Posted by x265 docs
can achieve significant gain in terms of objective quality metrics SSIM and PSNR
Which are not a measure for visual quality I'm afraid.
__________________
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 15th June 2021, 13:44   #8212  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Quote:
Originally Posted by Boulder View Post
Which are not a measure for visual quality I'm afraid.
The problem is in the combination of settings.
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 15th June 2021, 14:35   #8213  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 324
Quote:
Originally Posted by FranceBB View Post
Not really, I'm not an home user, I'm gonna be encoding professional UHD 12bit masterfiles coming from IMF Packages with MJPEG2000 RGB 12bit sources and I expect x265 to scale quite efficiently on all the cores. We'll see.
I get decent utilization up to about 24C/48T for UHD, we ofc have servers/clusters that exceeds that as we can push multiple encodes through them at the same time.

Could you please report back what frequency you are getting under high utilization with and without AVX512? We are moving to Epyc on all our encoding hardware, the frequency under load are just much higher compared to Intel in simulair price bracket were 32/64 CPU:s can push over 3Ghz under load.

Last edited by excellentswordfight; 15th June 2021 at 14:45.
excellentswordfight is offline   Reply With Quote
Old 15th June 2021, 15:16   #8214  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by Gravitator View Post
The problem is in the combination of settings.
Have you found out which particular one triggers it?

Not that I expect them to fix it even if you reported the issue at the bug tracker
__________________
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 15th June 2021, 16:48   #8215  |  Link
_kermit
Registered User
 
Join Date: Apr 2017
Posts: 63
Quote:
Originally Posted by rwill View Post
My intention was to check whether x265 would crash on the .y4m or complete. Because the input is the same as piped but pipe failed.

Regarding the size, you get ~6Mb per HD frame or ~24Mb per UHD frame. So at 24fps thats ~150 or ~600 Megabytes per second of video. So its not practical.
that's fine, I use pipeline again and with that command line the error is gone.

thanks!
_kermit is offline   Reply With Quote
Old 15th June 2021, 17:46   #8216  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by Boulder View Post
I kind of would expect CRF 10 to look very good. Of course, it depends on your requirements and viewing distance so testing the results with different CRF in your real life viewing conditions is always recommended.

In addition to your settings, I'd set --no-sao to disable the infamous Smooth All Objects functionality. I'd probably also use --deblock -1:-1.
I've seen quality improvements with some unusual sources down to CRF 12, certainly. But never anything below 10.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th June 2021, 18:02   #8217  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by K.i.N.G View Post
Thank you, I've lowered it to 16 and will report back when its finished.

I can live with 'slight' bitrate increases (which is perfectly understandable).
Also, are you looking at still frames of moving video? x265 and other encoders are tuned to optimize quality in-motion. Lots of things that look not-great when paused will go unnoticed when playing at full speed.

Reducing --ipratio and --pbratio can help with this as well, also increasing bitrate. There's also the experimental --aq-motion which might be worth poking out if you have idle encoding time.

I'm not sure why reducing --qg-size would help. That specifies the block size in which QP be can be varied, and is more useful for improving quality of content of highly variable detail.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th June 2021, 18:06   #8218  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by Boulder View Post
I kind of would expect CRF 10 to look very good. Of course, it depends on your requirements and viewing distance so testing the results with different CRF in your real life viewing conditions is always recommended.

In addition to your settings, I'd set --no-sao to disable the infamous Smooth All Objects functionality. I'd probably also use --deblock -1:-1.
Thx, I will add your parameters for the next encoding.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 15th June 2021, 18:10   #8219  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by benwaggoner View Post
I've seen quality improvements with some unusual sources down to CRF 12, certainly. But never anything below 10.
I never went below 14 with x264 (and even then friends declared me insane). Since I read the quality of x265 can often be lower, esecially in dark spots, I went as low as 10. With 10 more hours to gp on the final run, file size is estimated at 44G now, which I still deem acceptable. Shouldn't become much larger, though.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 23rd June 2021, 21:54   #8220  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Hey guys new here and really looking for some solid advice. I would greatly appreciate it.

I am in the process of backing up my Blu-Ray Collection that has a ton of movies in it. My CPU is pretty good, but for x265 especially, one movie would take a crazy amount of time. I have a lot of space on my NAS but not enough for full REMUXES of every movie so I want to encode the video ONLY. I want to passthrough the original Blu-Ray and 4K UHD Audio (DTS-MA/Dolby Atmos/True HD, etc). Can you guys please offer advice on the best program and settings to use? I know I want to use a really low CRF, and will keep the settings constant for every movie. In the event that the file ends up being just as big or bigger than the original, I can keep the original file instead of the encoded one. I prefer to keep the video as untouched as possible so no cropping or killing the grain, etc. I will watch the movies on something like Plex or KODI (direct play).

*Also, I should mentioned I tried Handbrake, but it seems limited on settings. For instance, you can only choose up to "Slow" as the slowest setting (no slower or placebo option). I would like a program easy to use that I can just run and not have to worry about checking screenshots for each movie, especially since I have so many movies.

Thank you guys so much!

Last edited by StormMeows; 23rd June 2021 at 21:57.
StormMeows 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 16:38.


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