rigaya / NVEnc

NVENCによる高速エンコードの性能実験
https://rigaya34589.blog.fc2.com/blog-category-17.html
Other
1.03k stars 108 forks source link

Transfer not set, with `--transfer smpte2084` #563

Closed Selur closed 4 months ago

Selur commented 4 months ago

Using a source with the following characteristics:

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 20 s 187 ms
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Writing library                          : ATEME Titan File 3.9.0 (4.9.0.0)
Default                                  : No
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd

and using:

ffmpeg -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "C:\Users\Selur\Desktop\Konig-Der-Lowen_10sec_edit.mkv" -map 0:0 -an -sn -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020c -color_range tv  -pix_fmt yuv420p10le -strict -1 -vsync 0 -f yuv4mpegpipe - | NVEncC --y4m -i - --fps 23.976 --codec h265 --profile main --level auto --tier high --sar 1:1 --lookahead 16 --output-depth 10 --vbr 0 --vbr-quality 23.00 --aq --aq-strength 5 --aq-temporal --gop-len 0 --ref 7 --multiref-l0 3 --multiref-l1 3 --bframes 3 --bref-mode auto --mv-precision Q-pel --preset quality --colorrange limited --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --max-cll ,1000 --master-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1) --cuda-schedule sync --output "J:\tmp\Konig-Der-Lowen_10sec_edit_new_1_2024-02-29@15_54_39_0210_01.265"

I get:

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L6@High
HDR format                               : SMPTE ST 2086
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 20 s 187 ms
Bit rate                                 : 14.3 Mb/s
Maximum bit rate                         : 22.3 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.072
Stream size                              : 34.4 MiB (100%)
Encoded date                             : 2024-02-29 14:50:22 UTC
Tagged date                              : 2024-02-29 14:50:23 UTC
Color range                              : Limited
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
mdhd_Duration                            : 20270
Codec configuration box                  : hvcC

as output. Problem is the 'Transfer characteristics' is missing! According to https://github.com/rigaya/NVEnc/blob/master/NVEncC_Options.en.md#--transfer-string --transfer smpte2084 should work.

Am I missing something, doesn't --transfer smpte2084 work?

Would be nice if you could look into this.

Selur commented 4 months ago

Might also be a bug in MediaInfo.

Selur commented 4 months ago

doh forgot to set primaries