View Full Version : X265 command line for UHD-BD
jdobbs
16th November 2017, 22:34
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.
sneaker_ger
16th November 2017, 23:02
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?
jdobbs
16th November 2017, 23:43
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.
nevcairiel
16th November 2017, 23:58
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)
jdobbs
17th November 2017, 02:59
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.
sneaker_ger
17th November 2017, 09:31
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.)
excellentswordfight
17th November 2017, 10:11
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).
"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"
nevcairiel
17th November 2017, 10:14
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.
jdobbs
17th November 2017, 14:54
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... 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.
jdobbs
17th November 2017, 14:57
This should result in a uhd-bd compliant hevc stream for HDR10 material (P3 graded with 1000nits peaks).
"ffmpeg.exe" -probesize 100MB... Thanks. I'll try the settings you provided and let you know what I find.
jdobbs
17th November 2017, 17:40
This should result in a uhd-bd compliant hevc stream for HDR10 material (P3 graded with 1000nits peaks).
"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.
sneaker_ger
17th November 2017, 21:54
--vbv-maxrate 109000
Video bitrate must not exceed 100,000 kbps. Depending on disc type bitrates have to be much lower.
jdobbs
17th November 2017, 21:55
Has anybody ever actually tried any of these encodes on a commercial UHD-BD Player? It just doesn't seem to work.
jdobbs
17th November 2017, 21:56
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).
sneaker_ger
17th November 2017, 22:29
If MediaInfo doesn't show any difference try deeper (with e.g. Zond or CodecVisa).
jdobbs
18th November 2017, 00:00
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.
jdobbs
18th November 2017, 00:30
Here's what I got from Zond.
The original file:
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:
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.
sneaker_ger
18th November 2017, 07:27
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
wolflop
22nd December 2017, 13:13
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
jdobbs
22nd December 2017, 19:25
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 playerWhat did you use as a source? Was it reencoded?
wolflop
22nd December 2017, 22:17
Source was not reencoded. Hevc265mkv loaded in tsmuxer as you
proposed. Proceeded as in the readme file..
wolflop
jdobbs
23rd December 2017, 02:38
Source was not reencoded. Hevc265mkv loaded in tsmuxer as you
proposed. Proceeded as in the readme file..
wolflopAny way you could create a short (2-3 minutes) cut from the source so I can test it?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.