quietvoid / dovi_tool

dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
MIT License
578 stars 57 forks source link

Error reading MaxCLL and MaxFALL while parsing of xml generated by cm_analyze #274

Closed erazortt closed 6 months ago

erazortt commented 6 months ago

The following command: dovi_tool.exe generate --xml DV.xml --canvas-width 1920 --canvas-height 1080 --rpu-out generated_rpu.bin

will throw this error:

thread 'main' panicked at dolby_vision\src\xml\parser.rs:161:60:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }

when the xml was created using dolbys current v.5.4.1 of cm_analyze using the --bda flag. The reason is that the xml generated has the following Level6 data:

<Level6 level="6">
  <MaxCLL>787.849</MaxCLL>
  <MaxFALL>60.953</MaxFALL>
</Level6>

Please be aware of the fact that these are floats!

When this data is manually changed to integers, everything is fine and no error is thrown:

<Level6 level="6">
  <MaxCLL>787</MaxCLL>
  <MaxFALL>60</MaxFALL>
</Level6>

Please update the parser to be able to read the xml generated by cm_analyze. It should just read the floats and immediately convert them to integers internally, I don't think float precission is necessary.

quietvoid commented 6 months ago

I wasn't aware the XML level 6 metadata could have decimals.