Code: Select all
----------------------------------------------------------------------------------------------------
--This workflow will convert an HDR10 or HDR10plus video to DoVi and set L5 automatically
--The black bars detection may not be perfectly accurate. It's maybe better to measure them manually
----------------------------------------------------------------------------------------------------
Drag and drop your HDR10 or HDR10plus MKV/MP4/TS file and press enter...D:\hdr10.ts
Do you want to crop RPU... y or n ? (y when HDR10-BL is cropped) and/or press enter...
ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Input #0, mpegts, from 'D:\hdr10.ts':
Duration: 00:07:08.39, start: 4200.000000, bitrate: 39049 kb/s
Program 1
Stream #0:0[0x1015](und): Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160, 23.98 fps, 23.98 tbr, 90k tbn
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
Output #0, matroska, to 'D:\TEMP\chunk.mkv':
Metadata:
encoder : Lavf59.16.100
Stream #0:0(und): Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160, q=2-31, 23.98 fps, 23.98 tbr, 1k tbn
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 6946 fps=882 q=-1.0 Lsize= 1387475kB time=00:04:59.96 bitrate=37891.5kbits/s speed=38.1x
video:1387407kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.004931%
Measuring the HDR10 video letterbox...
min: 0.0001 cd/m2, max: 1000 cd/m2
tsMuxeR version git-f4fa419. github.com/justdan96/tsMuxer
HEVC muxing fps is not set. Get fps from stream. Value: 23.976
B-pyramid level 1 detected. Shift DTS to 2 frames
99.0% complete
Processed 10273 video frames
100.0% complete
Flushing write buffer
Demux complete.
Demuxing time: 4 sec
Dolby Vision / SMPTE ST 2086
HDR10plus metadata not present. Generating DoVi from HDR10 with madVR...
Measuring video file "D:\hdr10.ts" using D3D11 (native)...
Metadata:
Mastering display luminance: 0.0001/1000, gamut: 0.68 0.32, 0.15 0.06, 0.265 0.69, 0.3127 0.329
MaxCLL: 0, MaxFALL: 0 nits
Measurements:
Frames: 10271, MaxCLL 100%: 623, 99.9%: 598, MaxFALL: 250, AvgFALL: 44, AvgFMLL: 416 nits
Parsing madVR measurement file...
Generating metadata: Profile 8.1 (HDR10)...
Generated metadata for 10271 frames
Done.
EditConfig {
mode: 0,
remove_cmv4: false,
remove_mapping: false,
active_area: Some(
ActiveArea {
crop: false,
drop_l5: None,
presets: Some(
[
ActiveAreaOffsets {
id: 0,
left: 0,
right: 0,
top: 276,
bottom: 276,
},
],
),
edits: Some(
{
"all": 0,
},
),
},
),
remove: None,
duplicate: None,
min_pq: None,
max_pq: None,
level6: None,
level9: None,
level11: None,
}
Parsing RPU file...
Editing active area offsets...
Final metadata length: 10271
Writing RPU file...
EditConfig {
mode: 0,
remove_cmv4: false,
remove_mapping: false,
active_area: None,
remove: None,
duplicate: None,
min_pq: None,
max_pq: None,
level6: Some(
ExtMetadataBlockLevel6 {
max_display_mastering_luminance: 1000,
min_display_mastering_luminance: 1,
max_content_light_level: 0,
max_frame_average_light_level: 0,
},
),
level9: None,
level11: None,
}
Parsing RPU file...
Final metadata length: 10271
Writing RPU file...
"left": 0
"right": 0
"top": 276
"bottom": 276
MDL.max: 1000
MDL.min: 1
Maxcll: 0
Maxfall: 0
Display P3
injecting RPU-L6-L5.bin ...
Parsing RPU file...
Processing input video for frame order info...
Warning: Input file already has RPUs, they will be replaced.
Warning: mismatched lengths. video 10274, RPU 10271
Metadata will be duplicated at the end to match video length
Rewriting file with interleaved RPU NALs..
Parsing RPU file...
{
"dovi_profile": 8,
"header": {
"rpu_nal_prefix": 25,
"rpu_type": 2,
"rpu_format": 18,
"vdr_rpu_profile": 1,
"vdr_rpu_level": 0,
"vdr_seq_info_present_flag": true,
"chroma_resampling_explicit_filter_flag": false,
"coefficient_data_type": 0,
"coefficient_log2_denom": 23,
"vdr_rpu_normalized_idc": 1,
"bl_video_full_range_flag": false,
"bl_bit_depth_minus8": 2,
"el_bit_depth_minus8": 2,
"vdr_bit_depth_minus_8": 4,
"spatial_resampling_filter_flag": false,
"reserved_zero_3bits": 0,
"el_spatial_resampling_filter_flag": false,
"disable_residual_flag": true,
"vdr_dm_metadata_present_flag": true,
"use_prev_vdr_rpu_flag": false,
"prev_vdr_rpu_id": 0,
"vdr_rpu_id": 0,
"mapping_color_space": 0,
"mapping_chroma_format_idc": 0,
"num_pivots_minus_2": [
0,
0,
0
],
"pred_pivot_value": [
[
0,
1023
],
[
0,
1023
],
[
0,
1023
]
],
"nlq_method_idc": null,
"nlq_num_pivots_minus2": null,
"nlq_pred_pivot_value": null,
"num_x_partitions_minus1": 0,
"num_y_partitions_minus1": 0
},
"rpu_data_mapping": {
"mapping_idc": [
[
0
],
[
0
],
[
0
]
],
"mapping_param_pred_flag": [
[
false
],
[
false
],
[
false
]
],
"num_mapping_param_predictors": [
[
0
],
[
0
],
[
0
]
],
"diff_pred_part_idx_mapping_minus1": [
[],
[],
[]
],
"poly_order_minus1": [
[
0
],
[
0
],
[
0
]
],
"linear_interp_flag": [
[
false
],
[
false
],
[
false
]
],
"pred_linear_interp_value_int": [
[],
[],
[]
],
"pred_linear_interp_value": [
[],
[],
[]
],
"poly_coef_int": [
[
[
0,
1
]
],
[
[
0,
1
]
],
[
[
0,
1
]
]
],
"poly_coef": [
[
[
0,
0
]
],
[
[
0,
0
]
],
[
[
0,
0
]
]
],
"mmr_order_minus1": [
[],
[],
[]
],
"mmr_constant_int": [
[],
[],
[]
],
"mmr_constant": [
[],
[],
[]
],
"mmr_coef_int": [
[],
[],
[]
],
"mmr_coef": [
[],
[],
[]
]
},
"vdr_dm_data": {
"compressed": false,
"affected_dm_metadata_id": 0,
"current_dm_metadata_id": 0,
"scene_refresh_flag": 0,
"ycc_to_rgb_coef0": 9574,
"ycc_to_rgb_coef1": 0,
"ycc_to_rgb_coef2": 13802,
"ycc_to_rgb_coef3": 9574,
"ycc_to_rgb_coef4": -1540,
"ycc_to_rgb_coef5": -5348,
"ycc_to_rgb_coef6": 9574,
"ycc_to_rgb_coef7": 17610,
"ycc_to_rgb_coef8": 0,
"ycc_to_rgb_offset0": 16777216,
"ycc_to_rgb_offset1": 134217728,
"ycc_to_rgb_offset2": 134217728,
"rgb_to_lms_coef0": 7222,
"rgb_to_lms_coef1": 8771,
"rgb_to_lms_coef2": 390,
"rgb_to_lms_coef3": 2654,
"rgb_to_lms_coef4": 12430,
"rgb_to_lms_coef5": 1300,
"rgb_to_lms_coef6": 0,
"rgb_to_lms_coef7": 422,
"rgb_to_lms_coef8": 15962,
"signal_eotf": 65535,
"signal_eotf_param0": 0,
"signal_eotf_param1": 0,
"signal_eotf_param2": 0,
"signal_bit_depth": 12,
"signal_color_space": 0,
"signal_chroma_format": 0,
"signal_full_range_flag": 1,
"source_min_pq": 7,
"source_max_pq": 3079,
"source_diagonal": 42,
"cmv29_metadata": {
"num_ext_blocks": 3,
"ext_metadata_blocks": [
{
"Level1": {
"min_pq": 0,
"max_pq": 2708,
"avg_pq": 1141
}
},
{
"Level5": {
"active_area_left_offset": 0,
"active_area_right_offset": 0,
"active_area_top_offset": 276,
"active_area_bottom_offset": 276
}
},
{
"Level6": {
"max_display_mastering_luminance": 1000,
"min_display_mastering_luminance": 1,
"max_content_light_level": 0,
"max_frame_average_light_level": 0
}
}
]
},
"cmv40_metadata": {
"num_ext_blocks": 3,
"ext_metadata_blocks": [
{
"Level9": {
"length": 1,
"source_primary_index": 0
}
},
{
"Level11": {
"content_type": 1,
"whitepoint": 0,
"reference_mode_flag": true,
"reserved_byte2": 0,
"reserved_byte3": 0
}
},
{
"Level254": {
"dm_mode": 0,
"dm_version_index": 2
}
}
]
}
},
"rpu_data_crc32": 867262424
}
"The script has completed."