quietvoid / hdr10plus_tool

CLI utility to work with HDR10+ in HEVC files.
MIT License
301 stars 33 forks source link

Error parsing file #34

Closed stillempty closed 3 years ago

stillempty commented 3 years ago

Reading parsed dynamic metadata... Done. Reordering metadata... thread 'main' panicked at 'called Option::unwrap() on a None value', src\hdr10plus\parser.rs:341:18 stack backtrace: 0: 0x7ff74e62217f - 1: 0x7ff74e63752a - 2: 0x7ff74e61f4b8 - 3: 0x7ff74e624bc6 - 4: 0x7ff74e6246a9 - 5: 0x7ff74e625225 - 6: 0x7ff74e624de3 - 7: 0x7ff74e622acf - 8: 0x7ff74e624d69 - 9: 0x7ff74e643ef0 - 10: 0x7ff74e643e3c - 11: 0x7ff74e4f9197 - 12: 0x7ff74e506883 - 13: 0x7ff74e4f8691 - 14: 0x7ff74e4f1fd6 - 15: 0x7ff74e4f244c - 16: 0x7ff74e62563a - 17: 0x7ff74e4f90b7 - 18: 0x7ff74e63e080 - 19: 0x7ffab4297974 - BaseThreadInitThunk 20: 0x7ffab6b6a2f1 - RtlUserThreadStart

If there is any other data you need please let me know.

quietvoid commented 3 years ago

A sample to reproduce is necessary.

stillempty commented 3 years ago

I am fairly new to github. The video file is about 2.8 GB, if you need the whole file, how is the best way to get it to you?

quietvoid commented 3 years ago

I'm not sure, maybe MEGA?

quietvoid commented 3 years ago

I have downloaded the file, thanks.

quietvoid commented 3 years ago

I had no problem parsing the file with version 0.5.0. What exact command line are you getting the error with?

stillempty commented 3 years ago

ffmpeg.exe -i S01E07.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | hdr10plus_parser -o metadata.json -

The other 7 episodes processed properly

quietvoid commented 3 years ago

Huh this is kinda weird, it doesn't always fail for me.

stillempty commented 3 years ago

I can test the metadata file you were able to extract if you like. So reading your comment it did fail for you also?

quietvoid commented 3 years ago

Yes it fails but not always.

quietvoid commented 3 years ago

This was interesting to fix. The problem only happened for stdin input (ffmpeg piping).

Since HDR10+ metadata is contained in SEI prefix NALs, the metadata was decoded before the actual frame slices. However because using stdin is unpredictable, sometimes the read data would end up decoding all the metadata, but skipping the very last slice, which is necessary for presentation order info.

Now the parsing should not skip any data. Thanks!