Advertisement
trds

Untitled

Sep 10th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.06 KB | None | 0 0
  1. [center][b][color=red][size=3]Injecting Dolby Vision from WEB-DL to HDR10 Remux[/color][/b][/center][/size]
  2.  
  3. [b][u]FFmpeg[/b][/u]
  4. https://github.com/BtbN/FFmpeg-Builds/releases - use this: ffmpeg-n4.4-151-g5e61fce832-win64-gpl-4.4.zip
  5. Install guide: https://www.easytechguides.com/install-ffmpeg/
  6.  
  7. [b][u]dovi_tool[/b][/u]
  8. https://github.com/quietvoid/dovi_tool/releases - dovi_tool-0.5.0-x86_64-pc-windows-msvc.tar.gz (check often for updates)
  9.  
  10. For this tutorial I pick Mortal Kombat (2021). This is a case where you need to work a bit more to match frames counting from WEB-DL to Remux. If it happens like movies from other sources (web and remux) are identical (frame on frame) you can skip the JSON.bin file and editing the RPU steps.
  11. Good luck!
  12.  
  13. [color=green][b]
  14. Windows 10 x64 OS
  15. dovi_tool path: D:\ENCODE\
  16.  
  17.  
  18. Open Command Prompt in Windows
  19. D:
  20. cd ENCODE[/color][/b]
  21.  
  22.  
  23. [b][u]Extract HEVC from Remux[/b][/u]
  24. [color=green][b]ffmpeg -i D:\MOVIES\Mortal.Kombat.2021.2160p.Remux.HEVC.HDR.TrueHD.Atmos.7.1-playBD\Mortal.Kombat.2021.2160p.Remux.HEVC.HDR.TrueHD.Atmos.7.1-playBD.mkv -c:v copy D:\ENCODE\hdr.hevc[/color][/b]
  25. [b][u]Extracting RPU.bin and converting from Profile 5 to Profile 8 (dvhe.05.06 -> dvhe.08.06) which would give it both DV and HDR10 compatibility, also permiting a fallback to standard HDR for non supported devices.[/b][/u]
  26.  
  27. [color=green][b]ffmpeg -i D:\MOVIES\Mortal.Kombat.2021.2160p.HMAX.WEB-DL.DDP5.1.DoVi.HEVC-cfandora.mp4 -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 3 extract-rpu -[/color][/b]
  28.  
  29. You'll get here a RPU.bin file located in same folder with dovi_tool.
  30.  
  31. Now you need to sync and edit the RPU.bin to match the frame count of the HDR10 stream (Remux) using a .JSON file awell located in same folder.
  32. Create a text file into same folder with dovi_tool, open it with notepad++, insert the code from below, and do a Save As on it with the name "edited" being saved as type "JSON file".
  33. [b][u]JSON Code:[/b][/u] https://pastebin.com/0TQmmA8V
  34.  
  35.  
  36. [b][u]Editing RPU.bin file[/b][/u]
  37. [color=green][b]dovi_tool.exe editor -i RPU.bin -j edited.json --rpu-out RPU-edited.bin[/color][/b]
  38.  
  39. [b][u]Injecting DoVI[/b][/u]
  40. [color=green][b]dovi_tool inject-rpu -i hdr.hevc --rpu-in RPU-edited.bin -o output.hevc[/color][/b]
  41.  
  42. Now is time to pass that output.hevc trough mkvtoolnix with all the shits to do the Remux. Thats all. Enjoy!
  43. Please dont use it stright! More test to do.
  44.  
  45. JSON files may be different from a movie to another so we need to do tests on more.
  46.  
  47. [b]WEB-DL DoVi Mediainfo:[/b]
  48. [spoiler]
  49. Video
  50. ID                                       : 1
  51. Format                                   : HEVC
  52. Format/Info                              : High Efficiency Video Coding
  53. Format profile                           : Main 10@L5@Main
  54. HDR format                               : Dolby Vision, Version 1.0, dvhe.05.06, BL+RPU
  55. Codec ID                                 : dvhe
  56. Codec ID/Info                            : High Efficiency Video Coding with Dolby Vision
  57. Duration                                 : 1 h 50 min
  58. Bit rate                                 : 17.9 Mb/s
  59. Width                                    : 3 840 pixels
  60. Height                                   : 2 160 pixels
  61. Display aspect ratio                     : 16:9
  62. Frame rate mode                          : Constant
  63. Frame rate                               : 23.976 (24000/1001) FPS
  64. Color space                              : YUV
  65. Chroma subsampling                       : 4:2:0
  66. Bit depth                                : 10 bits
  67. Bits/(Pixel*Frame)                       : 0.090
  68. Stream size                              : 13.7 GiB (96%)
  69. Writing library                          : x265 3.4hy:[Linux][GCC 7.5.0][64 bit] 10bit
  70. Encoding settings                        : cpuid=1111039 / frame-threads=1 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=3840x2160 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / repeat-headers / annexb / aud / hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=96 / keyint=96 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=4 / selective-sao=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=3 / rc=abr / bitrate=18000 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / vbv-maxrate=24500 / vbv-bufsize=24500 / vbv-init=0.6 / vbv-end=0.6 / vbv-end-fr-adj=0.0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=1 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / no-concatenation / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0
  71. Default                                  : Yes
  72. Alternate group                          : 1
  73. Encoded date                             : UTC 2021-04-23 11:00:19
  74. Tagged date                              : UTC 2021-04-23 11:00:19
  75. Color range                              : Full
  76. Codec configuration box                  : hvcC+dvcC[/spoiler]
  77.  
  78.  
  79. [b]Remux HDR Mediainfo:[/b]
  80. [spoiler]
  81. Video
  82. ID                                       : 2
  83. Format                                   : HEVC
  84. Format/Info                              : High Efficiency Video Coding
  85. Format profile                           : Main 10@L5.1@High
  86. HDR format                               : SMPTE ST 2086, HDR10 compatible
  87. Codec ID                                 : V_MPEGH/ISO/HEVC
  88. Duration                                 : 1 h 50 min
  89. Bit rate                                 : 59.7 Mb/s
  90. Width                                    : 3 840 pixels
  91. Height                                   : 2 160 pixels
  92. Display aspect ratio                     : 16:9
  93. Frame rate mode                          : Constant
  94. Frame rate                               : 23.976 (24000/1001) FPS
  95. Color space                              : YUV
  96. Chroma subsampling                       : 4:2:0 (Type 2)
  97. Bit depth                                : 10 bits
  98. Bits/(Pixel*Frame)                       : 0.300
  99. Stream size                              : 45.9 GiB (94%)
  100. Writing library                          : ATEME Titan File 3.9.6 (4.9.6.2)        
  101. Language                                 : English
  102. Default                                  : Yes
  103. Forced                                   : No
  104. Color range                              : Limited
  105. Color primaries                          : BT.2020
  106. Transfer characteristics                 : PQ
  107. Matrix coefficients                      : BT.2020 non-constant
  108. Mastering display color primaries        : Display P3
  109. Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
  110. Maximum Content Light Level              : 825 cd/m2
  111. Maximum Frame-Average Light Level        : 118 cd/m2
  112. [/spoiler]
  113.  
  114.  
  115. [b]playBD Hybrid DoVi Mediainfo:[/b]
  116. [spoiler]
  117. Video
  118. ID                                       : 1
  119. Format                                   : HEVC
  120. Format/Info                              : High Efficiency Video Coding
  121. Format profile                           : Main 10@L5.1@High
  122. HDR format                               : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
  123. Codec ID                                 : V_MPEGH/ISO/HEVC
  124. Duration                                 : 1 h 50 min
  125. Bit rate                                 : 59.8 Mb/s
  126. Width                                    : 3 840 pixels
  127. Height                                   : 2 160 pixels
  128. Display aspect ratio                     : 16:9
  129. Frame rate mode                          : Constant
  130. Frame rate                               : 23.976 (24000/1001) FPS
  131. Color space                              : YUV
  132. Chroma subsampling                       : 4:2:0 (Type 2)
  133. Bit depth                                : 10 bits
  134. Bits/(Pixel*Frame)                       : 0.301
  135. Stream size                              : 46.0 GiB (100%)
  136. Writing library                          : ATEME Titan File 3.9.6 (4.9.6.2)        
  137. Default                                  : Yes
  138. Forced                                   : No
  139. Color range                              : Limited
  140. Color primaries                          : BT.2020
  141. Transfer characteristics                 : PQ
  142. Matrix coefficients                      : BT.2020 non-constant
  143. Mastering display color primaries        : Display P3
  144. Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
  145. Maximum Content Light Level              : 825 cd/m2
  146. Maximum Frame-Average Light Level        : 118 cd/m2
  147. [/spoiler]
  148.  
  149.  
  150. [color=red]Waiting replies![/color]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement