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 10th August 2022, 14:42   #281  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Yeah, I think I'm getting it. Will play around and gonna try things out.

Thinking of it, I wonder how -QfG- injector would pipe this further. I assume that RPU itself wil be edited by the dovi_tool.exe.
In which case, do you perhaps know how dovitool's "RPU edit" basic commandline would look like? Say, with "RPU.bin" as input and using "custom.json" for the edits?

Thanks a bunch for your highly educating examples, GA.
You are very welcome! I have not tried this personally yet, but based on what @quietvoid and @-QfG have said and dovi_tool's documentation, I think this is how things work:

Let's say you have a file where most scenes have a standard AR (3840x1608), two have IMAX AR (3840x2076), and one is something in between (3840x1960). Then your "custom.json" file which is located next to your "RPU.bin" would look something like this:

Code:
{
  "mode": 0,
  "active_area": {
    "presets": [
      {
        "id": 0,
        "left": 0,
        "right": 0,
        "top": 276,
        "bottom": 276
      }
      {
        "id": 1,
        "left": 0,
        "right": 0,
        "top": 42,
        "bottom": 42
      }
      {
        "id": 2,
        "left": 0,
        "right": 0,
        "top": 100,
        "bottom": 100
      }
    ],
    "edits": {
      "all": 0,
      "1000-1234": 1,
      "2400-2468": 2,
      "4800-4848": 1
    }
  }
}
You can then use the following command to edit your RPU:

Code:
dovi_tool editor -i RPU.bin -j custom.json -o Edited_RPU.bin
What this essentially does is to first assign the default AR L5 borders to all frames, then overwrite it for the frames specified. From what @-QfG- has said, I think if you have a "custom.json" file directly next to the "RPU.bin" file, when using DDVT_INJECTOR the tool first edits the RPU (using the dovi_tool command above) and then injects it into the mkv.
GodzilaAvenger is offline   Reply With Quote
Old 10th August 2022, 20:40   #282  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 625
Very nice to learn the default for "all" and overwrite later.
Thanks again. I'm learning as I read and will try it all out. Have busy times ahead

I noticed "mode": 0, in the beginning. You know what it does? It's not in the earlier codes I read.
von Suppé is offline   Reply With Quote
Old 10th August 2022, 23:14   #283  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
I noticed "mode": 0, in the beginning. You know what it does? It's not in the earlier codes I read.
Based on this, it determines whether any conversion needs to be done, mode 0 parses the RPU and rewrites it untouched.
GodzilaAvenger is offline   Reply With Quote
Old 11th August 2022, 08:21   #284  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 625
Could have rung a bell. Didn't realise it was meant as the same "mode" argument when extracting.

In the meantime I also "discovered" quietvoid's editor.md and the examples at GitHub. Never was aware. Terrible...

Cheers, GA
von Suppé is offline   Reply With Quote
Old 13th August 2022, 08:32   #285  |  Link
Grimm
Registered User
 
Join Date: Jun 2022
Posts: 4
Please add the option to save the output file to another location
Grimm is offline   Reply With Quote
Old 13th August 2022, 17:58   #286  |  Link
Lucius Snow
Registered User
 
Join Date: Oct 2003
Posts: 157
Hi -QfG- and thanks for this great tool.

As the HDR10+ contains tone mapping at 400 nits or 500 nits only, is your tool able to convert to Dolby Vision RPU with others profiles such as SDR 100 nits tone-mapping data?
Lucius Snow is offline   Reply With Quote
Old 13th August 2022, 19:31   #287  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 568
Quote:
Originally Posted by Lucius Snow View Post
As the HDR10+ contains tone mapping at 400 nits or 500 nits only, is your tool able to convert to Dolby Vision RPU with others profiles such as SDR 100 nits tone-mapping data?
Converting HDR10+ to Dolby Vision isn't supported.
__________________
LG C2 OLED | GitHub Projects
quietvoid is offline   Reply With Quote
Old 13th August 2022, 20:52   #288  |  Link
-QfG-
QfG Group Germany
 
-QfG-'s Avatar
 
Join Date: Oct 2018
Location: Germany
Posts: 245
Quote:
Originally Posted by Grimm View Post
Please add the option to save the output file to another location
Will add this in the next Update.
-QfG- is offline   Reply With Quote
Old 13th August 2022, 22:59   #289  |  Link
Lucius Snow
Registered User
 
Join Date: Oct 2003
Posts: 157
Quote:
Originally Posted by quietvoid View Post
Converting HDR10+ to Dolby Vision isn't supported.
I was talking about the metadatas (JSON to RPU).

Quote:
-Convert HDR10+ Metadata to DoVi Metadata (Experimental).
What about the tone mapping?
Lucius Snow is offline   Reply With Quote
Old 14th August 2022, 00:00   #290  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 568
Quote:
Originally Posted by Lucius Snow View Post
I was talking about the metadatas (JSON to RPU).
What about the tone mapping?
The HDR10+ tone mapping curve isn't mapped to Dolby Vision.
Only the frame brightness analysis is copied to the RPU.
__________________
LG C2 OLED | GitHub Projects
quietvoid is offline   Reply With Quote
Old 14th August 2022, 13:30   #291  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 538
Quote:
Originally Posted by von Suppé View Post
@Balling

Actually, "sync" is the exact reason why it is done. A lot of people convert video 24 <--> 23.976 by rewriting timestamps. Not to get out of sync with its native audio, but to get in sync with other.
As an example, imagine having a TrueHD + Atmos track from a 24 fps source and a desired videotrack from a 23.976 source. No way you can speed-down Atmos while keeping Atmos format (with freeware, that is). But if you'd instead speed-up the video by rewriting timestamps, it can sync to the native Atmos track.
As for subs, that's a no-brainer. They can be resynced in the blink of an eye.

If you introduce framerate conversion; for RPU there's no need. You might have considered the reason why anybody would do such anyway.
Correct
Balling is offline   Reply With Quote
Old 14th August 2022, 14:11   #292  |  Link
Grimm
Registered User
 
Join Date: Jun 2022
Posts: 4
Quote:
Originally Posted by -QfG- View Post
Will add this in the next Update.
Great thanks
Grimm is offline   Reply With Quote
Old 15th August 2022, 15:16   #293  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 625
Ok, think I managed to edit L5 to proper values for all frameranges of the movie "Interstellar". Wow, this sweety switches aspect ratio 125 times (!) if my count is right. Where a lot of switches happen after just a few seconds of each other. Quite some work...

Anyways, I had to apply a delay. Which of course went fine with -QfG- injector.
Reading the editor.md, am I right when assuming the "duplicate" and "remove" arguments are used for applying positive and negative delay?
Or is there a true "delay" argument? I couldn't find such at the editor examples.
von Suppé is offline   Reply With Quote
Old 15th August 2022, 15:25   #294  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 568
Quote:
Originally Posted by von Suppé View Post
Reading the editor.md, am I right when assuming the "duplicate" and "remove" arguments are used for applying positive and negative delay?
Or is there a true "delay" argument? I couldn't find such at the editor examples.
There's only duplicate and remove, so it's probably using them to delay.
__________________
LG C2 OLED | GitHub Projects
quietvoid is offline   Reply With Quote
Old 15th August 2022, 15:44   #295  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 625
Excellent. Thanks, quietvoid.
von Suppé is offline   Reply With Quote
Old 15th August 2022, 16:06   #296  |  Link
Fortune
Registered User
 
Join Date: Aug 2022
Posts: 2
Thanks for the great tool. I am very new to this and have a simple question.
How can i see all the frame info for the RPU for a particular movie?
Currently I use the DDVT_FRAMEINFO but this tool is only for a specific frame. Is there a way for it to ouput all frames?
Reason being I wish to see the active area for films that have changing active areas. Like for Aquaman.
Thanks in advance.
Fortune is offline   Reply With Quote
Old 15th August 2022, 19:07   #297  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Ok, think I managed to edit L5 to proper values for all frameranges of the movie "Interstellar". Wow, this sweety switches aspect ratio 125 times (!) if my count is right. Where a lot of switches happen after just a few seconds of each other. Quite some work...

Anyways, I had to apply a delay. Which of course went fine with -QfG- injector.
Reading the editor.md, am I right when assuming the "duplicate" and "remove" arguments are used for applying positive and negative delay?
Or is there a true "delay" argument? I couldn't find such at the editor examples.
I did this for Civil War yesterday, which thankfully only had one IMAX scene so it was much much easier. My RPU was out of sync with the movie (it needed to be delayed by 2 frames). Here's what I did (for simplicity assume the IMAX frames where from 1000 to 2000):

1. Created a custom.json file with the L5 metadata next to the RPU.bin file, something like this:

Code:
{
  "mode": 0,
  "active_area": {
    "crop": false,
    "presets": [
      {
        "id": 0,
        "left": 0,
        "right": 0,
        "top": 280,
        "bottom": 280
      },
	  {
        "id": 1,
        "left": 0,
        "right": 0,
        "top": 69,
        "bottom": 69
      }
    ],
    "edits": {
      "all": 0,
      "1000-2000": 0,
    }
  }
}
2. Since DDVT_INJECTOR first applies the custom.json file, then the delay, I shifted the frame range values by 2, so something like this:

Code:
{
  "mode": 0,
  "active_area": {
    "crop": false,
    "presets": [
      {
        "id": 0,
        "left": 0,
        "right": 0,
        "top": 280,
        "bottom": 280
      },
	  {
        "id": 1,
        "left": 0,
        "right": 0,
        "top": 69,
        "bottom": 69
      }
    ],
    "edits": {
      "all": 0,
      "998-1998": 0,
    }
  }
}
Then, I used DDVT_INJECTOR and for delay entered 2. It did the rest of the work. I checked afterwards and everything was accurate, i.e. frames 1000 to 2000 had the IMAX L5 borders.
GodzilaAvenger is offline   Reply With Quote
Old 15th August 2022, 19:13   #298  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by Fortune View Post
Thanks for the great tool. I am very new to this and have a simple question.
How can i see all the frame info for the RPU for a particular movie?
Currently I use the DDVT_FRAMEINFO but this tool is only for a specific frame. Is there a way for it to ouput all frames?
Reason being I wish to see the active area for films that have changing active areas. Like for Aquaman.
Thanks in advance.
Use DDVT_DEMUXER to extract the RPU.bin file, then go to the tools folder and use dovi_tool export, i.e.

Code:
cd tools
./dovi_tool export [args]
(populate [args] with the proper arguments). This will convert RPU.bin into a .json file which you can view in a text editor.

On a side note, DDVT_FRAMEINFO seems to extract RPU.bin from the .mkv file each time it is called, which can be time-consuming. Instead you can use DDVT_DEMUXER to extract the RPU.bin file once and then use dovi_tool info to get information about a specific frame.
GodzilaAvenger is offline   Reply With Quote
Old 16th August 2022, 08:19   #299  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 625
Quote:
Originally Posted by GodzilaAvenger View Post
2. Since DDVT_INJECTOR first applies the custom.json file, then the delay, I shifted the frame range values
Damn, I think this is where I went wrong. My end result doesn't look good. Border changes clearly aren't in sync. I applied 24 frames delay but the framerange edits were already from target video.
I extracted the endresult RPU and checked some frame-infos. Indeed they shifted 24 frames. Like 100-150 was adjusted to 124-174.

No way I'm gonna manually edit my json. Gonna figure out how dovitool.exe "duplicate" argument works and first try to only apply delay. After which I'll use the "delay-corrected RPU" as input for the json L5 edits. Learning as I get by...

Thanks, GodzilaAvenger. You saved the day once again!

Last edited by von Suppé; 16th August 2022 at 08:29.
von Suppé is offline   Reply With Quote
Old 16th August 2022, 09:05   #300  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Damn, I think this is where I went wrong. My end result doesn't look good. Border changes clearly aren't in sync. I applied 24 frames delay but the framerange edits were already from target video.
I extracted the endresult RPU and checked some frame-infos. Indeed they shifted 24 frames. Like 100-150 was adjusted to 124-174.

No way I'm gonna manually edit my json. Gonna figure out how dovitool.exe "duplicate" argument works and first try to only apply delay. After which I'll use the "delay-corrected RPU" as input for the json L5 edits. Learning as I get by...

Thanks, GodzilaAvenger. You saved the day once again!
Always a pleasure

One thing you could do is extract the RPU using the DEMUXER, apply the delay when using the INJECTOR to get it in sync with the movie (no custom.json for now, borders are set in the next step), extract the new RPU using the DEMUXER, this time using INJECTOR with 0 delay along with custom.json.

To get the RPU in sync with the movie, I usually use dovi_tool info on that RPU to look at values for "max_pq", i.e. something like this
Code:
dovi_tool.exe info -i RPU.bin -f 1000 | Select-String "max_pq"
"max_pq" is usually set scene-by-scene, so I look for two consecute frames where it changes, and correspond that with a cut (scene transition) in the film. This gives me the delay.

Finally, note that dovi_tool is 0-based, i.e. the first frame is numbered 0.
GodzilaAvenger 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 07:04.


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