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 16th November 2017, 22:34   #1  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
X265 command line for UHD-BD

Anyone have a recommended command line that will create an HEVC file that would be compliant for integration into a UHD-BD structure? I've tried several, but when I mux them the I don't get a picture on my UHD player, only audio.

I've written code that can update a structure created by TSMUXER so that it is compliant with UHD-BD, and it works correctly if I use it with an HEVC steam from a UHD-BD -- but fails when used with my output from my attempts with X265 output.

I'm pulling my hair out -- any help would be appreciated.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs is offline   Reply With Quote
Old 16th November 2017, 23:02   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Can you post the command-line you tried unsuccessfully? Did you also try with --no-info? Are you using 8 bit, 10 bit or 12 bit build (or multi)? Frame rate/resolution?
sneaker_ger is offline   Reply With Quote
Old 16th November 2017, 23:43   #3  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by sneaker_ger View Post
Can you post the command-line you tried unsuccessfully? Did you also try with --no-info? Are you using 8 bit, 10 bit or 12 bit build (or multi)? Frame rate/resolution?
I'm using a 10 bit build. I think I may have found at least one issue... the version of X265 I'd downloaded wouldn't accept "--transfer smpte-st-2084". I found another build and am trying it now.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs is offline   Reply With Quote
Old 16th November 2017, 23:58   #4  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Including the piece of information that you want to do HDR would've been important (or if you're not, you should not be using smpte-st-2084)
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 17th November 2017, 02:59   #5  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by nevcairiel View Post
Including the piece of information that you want to do HDR would've been important (or if you're not, you should not be using smpte-st-2084)
Gee thanks. Typical response... you ask for help and instead get criticized because you didn't ask well enough.

How about a command line example of an encode that works? Maybe one with hdr and one without? Oh, I see, you're too busy nit-picking -- and probably haven't a clue.

I guess, as usual, I'm on my own.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 17th November 2017 at 03:04.
jdobbs is offline   Reply With Quote
Old 17th November 2017, 09:31   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by jdobbs View Post
the version of X265 I'd downloaded wouldn't accept "--transfer smpte-st-2084".
The cli parameter names were changed some time ago. So it just means one build is older than the other. (The actual encoding didn't change.)
sneaker_ger is offline   Reply With Quote
Old 17th November 2017, 10:11   #7  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 325
Quote:
Originally Posted by jdobbs View Post
How about a command line example of an encode that works?
This should result in a uhd-bd compliant hevc stream for HDR10 material (P3 graded with 1000nits peaks).

Code:
"ffmpeg.exe" -probesize 100MB -i "input" -pix_fmt yuv420p10le -an -f yuv4mpegpipe -strict -1 - | "x265.exe" --y4m --fps 24000/1001 --input-csp 1 --input-depth 10 --output-depth 10 --no-interlace --preset slow --vbv-maxrate 109000 --vbv-bufsize 109000 --uhd-bd --bitrate 50000 --pass 1 --slow-firstpass --sar 1 --hrd --aud --chromaloc 2 --hdr-opt --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" - -o nul

"ffmpeg.exe" -probesize 100MB -i "input" -pix_fmt yuv420p10le -an -f yuv4mpegpipe -strict -1 - | "x265.exe" --y4m --fps 24000/1001 --input-csp 1 --input-depth 10 --output-depth 10 --no-interlace --preset slow --vbv-maxrate 109000 --vbv-bufsize 109000 --uhd-bd --bitrate 50000 --pass 2 --sar 1 --hrd --aud --chromaloc 2 --hdr-opt --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" - -o "out.hevc"

Last edited by excellentswordfight; 17th November 2017 at 10:33.
excellentswordfight is offline   Reply With Quote
Old 17th November 2017, 10:14   #8  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
How about instead of insulting people you actually answer the questions you were asked, so people can help you?

There is already a thread with discussion about UHD BD x265 encoding here: https://forum.doom9.org/showthread.php?t=174491, which has a bunch of examples from people which allegedly work (I didn't test all of them), but the basic answer is that it really doesn't require many special commands, primarily either --uhd-bd or the equivalent individual options (--aud --no-open-gop --chromaloc 2), and possibly enabling hrd. And for HDR, the long list of appropriate mastering options.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 17th November 2017, 14:54   #9  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by nevcairiel View Post
How about instead of insulting people you actually answer the questions you were asked, so people can help you?

There is already a thread with discussion about UHD BD x265 encoding here: https://forum.doom9.org/showthread.php?t=174491, which has a bunch of examples from people which allegedly work (I didn't test all of them), but the basic answer is that it really doesn't require many special commands, primarily either --uhd-bd or the equivalent individual options (--aud --no-open-gop --chromaloc 2), and possibly enabling hrd. And for HDR, the long list of appropriate mastering options.
So... here's a quote from your previous post...
Quote:
Originally Posted by nevcairiel View Post
Including the piece of information that you want to do HDR would've been important (or if you're not, you should not be using smpte-st-2084)
Maybe you can help by showing me the question you asked? Not there? Yeah, I didn't think so.

I read that thread several days ago and tried pretty much every iteration I could find. None worked. I'm doing something wrong. I'll run the example provided above by excellentswordfight and see how it works.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 17th November 2017 at 15:17.
jdobbs is offline   Reply With Quote
Old 17th November 2017, 14:57   #10  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by excellentswordfight View Post
This should result in a uhd-bd compliant hevc stream for HDR10 material (P3 graded with 1000nits peaks).

Code:
"ffmpeg.exe" -probesize 100MB...
Thanks. I'll try the settings you provided and let you know what I find.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs is offline   Reply With Quote
Old 17th November 2017, 17:40   #11  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by jdobbs View Post
Quote:
Originally Posted by excellentswordfight View Post
This should result in a uhd-bd compliant hevc stream for HDR10 material (P3 graded with 1000nits peaks).

Code:
"ffmpeg.exe" -probesize 100MB...
Thanks. I'll try the settings you provided and let you know what I find.
Unfortunately I get the same result. If I mux it into UHD-BD format and burn it to a BD-RE, the playback is a blank screen with only audio. If, however, I take the original HEVC stream and mux/burn it in exactly the same way -- it plays back correctly.

The encoded and muxed M2TS file plays back fine on my computer with Media Player Classic -- but, of course, that's no real test.

Both streams appear the same when I look at them with MEDIAINFO.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 17th November 2017 at 18:09.
jdobbs is offline   Reply With Quote
Old 17th November 2017, 21:54   #12  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by excellentswordfight View Post
--vbv-maxrate 109000
Video bitrate must not exceed 100,000 kbps. Depending on disc type bitrates have to be much lower.
sneaker_ger is offline   Reply With Quote
Old 17th November 2017, 21:55   #13  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Has anybody ever actually tried any of these encodes on a commercial UHD-BD Player? It just doesn't seem to work.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 17th November 2017 at 22:09.
jdobbs is offline   Reply With Quote
Old 17th November 2017, 21:56   #14  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by sneaker_ger View Post
Video bitrate must not exceed 100,000 kbps. Depending on disc type bitrates have to be much lower.
I lowered it to 64000 in my tests (because it's on a BD-RE disc).
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 17th November 2017 at 22:05.
jdobbs is offline   Reply With Quote
Old 17th November 2017, 22:29   #15  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
If MediaInfo doesn't show any difference try deeper (with e.g. Zond or CodecVisa).
sneaker_ger is offline   Reply With Quote
Old 18th November 2017, 00:00   #16  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by sneaker_ger View Post
If MediaInfo doesn't show any difference try deeper (with e.g. Zond or CodecVisa).
I downloaded a trial version of CodecVisa -- honestly I couldn't make heads or tails of most of it. I tried comparing two streams -- but it didn't seem to do anything. Is Zond any easier? I tried downloading the demo package of zond and it keeps failing.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 18th November 2017 at 00:04.
jdobbs is offline   Reply With Quote
Old 18th November 2017, 00:30   #17  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Here's what I got from Zond.

The original file:
Code:
File info
Stream type	HEVC/H.265	
Profile	Main 10	
Level / Tier	5.1 / High	
Chroma subsampling	4:2:0	
Bit depth (Luma / Chroma)	10 / 10	Bits
Resolution	3840 x 2160 (Ultra HD)
Display aspect ratio	16 x 9	
Frame rate	23.98	
Frame count	1491	
Duration	00:01:02,186
Bitrate	41.6	Mbps
Stream size	323	MBytes
File size	323	MBytes
Proportion of this stream	0.99988	
High dynamic range (HDR)	Yes
Color range	Limited
Color description present	Yes
Color primaries	BT.2020
Transfer characteristics	SMPTE ST 2084
Matrix coefficients	BT.2020 non-constant
Maximum Content Light Level	1514
Maximum Frame-Average Light Level	172
Mastering display color primaries
    R	x=0.680000 y=0.320000
    G	x=0.265000 y=0.690000
    B	x=0.150000 y=0.060000
    White point	x=0.312700 y=0.329000
Mastering display luminance
    min	0.005000	cd/m2
    max	4000.000000	cd/m2
GOP length
Maximum GOP length	875 msec (21 frames)
Minimum GOP length	41 msec (1 frames)
Median of GOP length	562 msec (13 frames)
Standard deviation of GOP length	381.49 msec (9.15 frames)
Frame sizes
Average frame size	222	KBytes
Average I frame size	457	KBytes
Average P frame size	279	KBytes
Average B frame size	150	KBytes

Compression efficiency
Compressed size	323	MBytes
Uncompressed size	0	Bytes
bits per bin	0.25	
bits per pixel	5.29	
compression ratio	0.00	
motion vectors per pixel	0.0000	
Elements		%	bits
residuals	
1.30	232
mvd	
0.00	0
merge_idx	
0.00	0
skip_flag	
0.00	0
split_coding_unit_flag	
3.44	613
part_mode	
0.31	56
merge_flag	
0.00	0
cbf_cr	
1.94	346
cbf_luma	
3.00	535
slice header	
2.83	504
inter_dir_pu	
0.00	0
intra pred modes	
51.75	9233
no_residual_data_flag	
0.00	0
mvp_flag	
0.00	0
ref_idx	
0.00	0
cbf_cb	
2.22	396
others	
32.76	5844
pred_mode_flag	
0.00	0
end_of_slice_flag	
0.14	25
cu_qp_delta	
0.31	56
split_transform_flag	
0.00	0
CU types		%	Pixels
intra	
100.00	8294400
inter	
0.00	0
Intra PU sizes		%	Numbers
8x8	
0.38	32
16x16	
3.17	264
32x32	
96.45	8032
TU (Y) sizes		%	Numbers
8x8	
100.00	8
Intra PU (Y) 		8x8	16x16	32x32
PLANAR	
16 (0.19%)	24 (0.29%)	4072 (48.90%)
DC	
16 (0.19%)	240 (2.88%)	3960 (47.55%)
Intra PU (C) 		8x8	16x16	32x32
PLANAR	
16 (0.19%)	24 (0.29%)	4072 (48.90%)
DC	
16 (0.19%)	240 (2.88%)	3960 (47.55%)
And for the newly encoded file:
Code:
File info
Stream type	HEVC/H.265	
Profile	Main 10	
Level / Tier	5.1 / High	
Chroma subsampling	4:2:0	
Bit depth (Luma / Chroma)	10 / 10	Bits
Resolution	3840 x 2160 (Ultra HD)
Display aspect ratio	16 x 9	
Frame rate	23.98	
Frame count	1492	
Duration	00:01:02,228
Bitrate	33.1	Mbps
Stream size	257	MBytes
File size	257	MBytes
Proportion of this stream	1	
High dynamic range (HDR)	Yes
Color range	Limited
Color description present	Yes
Color primaries	BT.2020
Transfer characteristics	SMPTE ST 2084
Matrix coefficients	BT.2020 non-constant
Maximum Content Light Level	1000
Maximum Frame-Average Light Level	400
Mastering display color primaries
    R	x=0.680000 y=0.320000
    G	x=0.265000 y=0.690000
    B	x=0.150000 y=0.060000
    White point	x=0.312700 y=0.329000
Mastering display luminance
    min	0.005000	cd/m2
    max	4000.000000	cd/m2
GOP length
Maximum GOP length	1001 msec (24 frames)
Minimum GOP length	41 msec (1 frames)
Median of GOP length	1001 msec (24 frames)
Standard deviation of GOP length	276.26 msec (6.62 frames)
Frame sizes
Average frame size	176	KBytes
Average I frame size	417	KBytes
Average P frame size	241	KBytes
Average B frame size	142	KBytes

Compression efficiency
Compressed size	257	MBytes
Uncompressed size	0	Bytes
bits per bin	0.50	
bits per pixel	5.32	
compression ratio	0.00	
motion vectors per pixel	0.0000	
Elements		%	bits
residuals	
0.09	38
mvd	
0.00	0
merge_idx	
0.00	0
skip_flag	
0.00	0
split_coding_unit_flag	
0.93	376
part_mode	
0.00	0
merge_flag	
0.00	0
cbf_cr	
0.69	280
cbf_luma	
0.76	310
slice header	
0.79	320
inter_dir_pu	
0.00	0
intra pred modes	
62.45	25375
no_residual_data_flag	
0.00	0
mvp_flag	
0.00	0
ref_idx	
0.00	0
cbf_cb	
0.62	250
others	
33.62	13659
pred_mode_flag	
0.00	0
end_of_slice_flag	
0.03	12
cu_qp_delta	
0.03	12
split_transform_flag	
0.00	0
CU types		%	Pixels
intra	
100.00	8294400
inter	
0.00	0
Intra PU sizes		%	Numbers
16x16	
2.90	240
32x32	
97.10	8040
TU (Y) sizes		%	Numbers
32x32	
100.00	1
Intra PU (Y) 		16x16	32x32
PLANAR	
0 (0.00%)	4080 (49.28%)
DC	
240 (2.90%)	3960 (47.83%)
Intra PU (C) 		16x16	32x32
PLANAR	
240 (2.90%)	3960 (47.83%)
ANGULAR34	
0 (0.00%)	4080 (49.28%)
The original file works... the second one doesn't.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs is offline   Reply With Quote
Old 18th November 2017, 07:27   #18  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
I meant compare VPS/SPS/PPS. In Zond should be "Bitstream" and then expand the first NALUs. Also look for differences in general NALU structure/order (same SEIs before the picture NALUs, same order?).

Or maybe we try it the other way: you test files created by us on your player: https://www.sendspace.com/file/ezphty
sneaker_ger is offline   Reply With Quote
Old 22nd December 2017, 13:13   #19  |  Link
wolflop
Registered User
 
Join Date: Sep 2009
Posts: 45
I have created a BD structure with the tsmuxer (UHD mkv). Then edited as specified with the TSMUhdmuxer. Unfortunately, only audio and no picture is playable on the player
wolflop is offline   Reply With Quote
Old 22nd December 2017, 19:25   #20  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,975
Quote:
Originally Posted by wolflop View Post
I have created a BD structure with the tsmuxer (UHD mkv). Then edited as specified with the TSMUhdmuxer. Unfortunately, only audio and no picture is playable on the player
What did you use as a source? Was it reencoded?
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs 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 21:44.


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