-
-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Data levels issues #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…into issues/issue-200-Data-levels-issues
A lot of research going into this issue when I have the time! Check out: So far it seems like the issue is inconsistent across projects. It's not an 8-bit / 10-bit issue like I originally thought it was. My bad. Internally generated 8-bit footage data levels interpreted correctly, but superwhites and superblacks clamped. It appears to be that proxies generated through ffmpeg are being given video-levels when they should be full. Likely one of our cameras has had its levels set to full (0-255) instead of (16-235) so the ranges written differ from the metadata and that's why it's inconsistent? Just a guess. Will continue testing and see. |
- Probe input file for correct color range - Add support for Resolve data level overrides
TL;DRAlright! Finally figured it out.... Ffmpeg on the other hand is not interpreting the input levels correctly and sets them to
Finally, The inconsistency I was experiencing was due to two cameras shooting with different levels settings. The one set to TestingI tested so many codecs... Resolve, Adobe Media Encoder, raw ffmpeg, Shutter Encoder, etc, greped and diffed metadata and colour metadata was identical between files that were interpreted differently by Resolve. A very confusing time! EncodeThis is essentially the command I was testing with Proxima under the hood. Using ProRes 422 Proxy instead of DNxHR SQ to ensure 10-bit and low bitrate. I was concerned that ProRes's Quicktime container can't contain colour metadata and so maybe incorrect interpretation was due to that, but 10/12-bit DNxHR variants were just as bad: ffmpeg -y -hide_banner -stats -i "Desktop\infile.mov" -c:v dnxhd -profile:v dnxhr_sq -vf scale=-2:720 -vf scale=in_range=full:out_range=full -vf format=yuv422p -c:a pcm_s16le -ar 48000 -movflags +write_colr "Desktop\outfile.mov" Check bits per Raw SampleJust to ensure the bit-depth was being set correctly I tested files with this command: ffprobe -loglevel panic -show_entries stream=bits_per_raw_sample -select_streams v "videofile.mov" Check Y Min MaxThis checks the minimum and maximum luminance levels for YUV. This was when I realised real-world levels were different between files that otherwise had identical metadata. ffprobe -f lavfi movie="Desktop/infile.mov",signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN Check ColourI ran this on each file to check ffprobe -v error -show_streams "Desktop/outfile.mov" | grep color_ Results
After adding that last entry to the table, I figured out the relationship ffmpeg video filter settings Dan's Camera -
Dave's Camera -
I compared each shot with Interestingly, setting levels to Our only correct ffmpeg interpretation was ProposalIf data levels are set to If data levels are set specifically to Always set ConclusionConfirmed data-level matching working in latest tests. Proxima now attempts to match Resolve's interpretation as closesly as possible, even if metadata is set incorrectly and Resolve's interpretation will be wrong. Incorrect interpretations can be fixed by setting data levels manually and re-encoding as needed to match new settings (just as clip-attribute level orientation settings work). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed an issue where the main video stream may not be the first stream probed by ffprobe. This caused a key error for color_range
and would crash the worker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Color range issues
Problem
I'm a little confused about this. Not sure what's going on.
If data levels are set to auto (interpreted as "full" I guess), proxies are still being exported with limited range and they appear to have much more contrast; crushed blacks and blown-out whites. It doesn't happen for proxy media generated internally.
Add support
If we can get ffmpeg to encode with the correct data levels, we still need to know what the input levels are. Since clip properties returned through the api can have
levels
set toauto
, we'll have to alert the user that they should probably set the clips explicitly to "full" or "video".ProRes support hurdles
There's also a concern about using ProRes. ProRes doesn't have a flag to tell the player how the colour data should be interpreted. I believe Resolve 18 allows for ProRes proxies, so maybe we should see how they're handling it? Some additional custom metadata? Some internal forced level interpretation? A new implementation for 18 altogether?
If special handling is required for some codecs like ProRes, we may need to add some data-levels settings to the proposed render-presets. Something like:
Additional Resources
closes #200