-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
V-Log / VARICAM support #3157
Comments
Fascinating. This might be the first exponential transfer function I have come across. I'll give it a try later, shouldn't be too difficult. LittleCMS integration will probably not be possible, though, so we will have to use the same trick as with HDR. Do you know if this transfer is also designed to map to a fixed absolute brightness (as SMPTE ST2084 does), or is it screen-referred like typical transfer curves? |
V-Log is not meant to map absolute brightness, it's kind of also not screen-referred, it's "camera sensor-referred". Its primary purpose is to stuff all the dynamic range that the camera can record into "ordinary" video formats such that in post-production, the editor still has all the information from the very dark and the very bright areas available, so he can choose what part of this information "to throw away" while grading colors. So a transformation from V-Log to whatever colorspace and dynamic range the display supports, for the "quick review" or "compressed domain edit" purpose should not clip away darks/lights, but enhance the contrast to some "normal" level, as if the material had not been recorded using V-Log. Unlike with (already post-processed, color graded) HDR material, the purpose here cannot be to match some reference image, as there is none at the time when the V-Log material is reviewed. (Here's some Blog article explaining some pro's and con's of using V-Log as background information.) |
I tried implementing it but I still don't really understand how V-Log is supposed to make sense. If I just plug in the formulas from the document, I get results like V-Log 1.0 translating to a value of ≈46.0855. How am I supposed to work with a weird value like that? Just brute-force renormalize to [0,1] and then treat it as being relative to target-brightness * 46 lux? This spec might make some sense for cameras but it certainly doesn't really make sense inside a video player.. would probably be a better idea to just use a custom user shader for your particular use case (if you just want to get a useful display out of your V-Log sources). |
Your calculation is correct: V-Log "1.0" (meaning the highest code value, so code 1023 for 10-bit code) indeed exceeds "100% IRE" by a lot. For 10 bits, code value 613 (aka V-Log 0.6) seems to be the one associated with "100% IRE". I can only assume they understand IRE here as "the white in a standard non-glossy reflective color target, as illuminated by the ambient light" - such color targets are often shot with cameras for calibration purposes - but of course an active light source or a glossy reflection of a point light source on a metal orb would be recorded "brighter than the 100% IRE region on the reflective color target" by the camera, and thus yield a higher code value. The V-Log function seems to have been defined with lots of "headroom" for cameras with higher-than-currently-available-dynamic-range. According to the X-axis, the 10-bit code values from 128 to 1023 cover 16 f-stops of dynamic range - but there is no Panasonic camera with that much dynamic range on the market. The GH4, for example, which recorded the sample linked above, has a dynamic range of only 12 f-stops. If you look at this image: https://suggestionofmotion.com/wp-content/uploads/Panasonic_V-Log_Graph-693x434.jpg we can see that the camera is supposed to use the "left aligned" codes (starting from 128) up to some clipping value it is capable of at max. So I think the right thing to do here is to create a parameter to input either the clipping code value or the respective number of f-stops (which has the advantage of not being dependend on 10-bit or 12-bit code values), and then clip all higher code values (which should never occur in the encoded material) to the maximum display luminance. For the GH4 sample linked above, here is a download of 3d LUTs from Panasonic which are meant to map the V-Log codes into bt.709 - maybe you can use this for verification. (BTW: Panasonic calls the part of the V-Log code space that the GH4 can use "V-Log L" with "L" for "Light".) One more link to mention here, to an article on some properties of V-Log on the GH4, might also help. |
User request and not that hard. Closes mpv-player#3157. Note that FFmpeg doesn't support this and there's no signalling in HEVC etc., so the only way users can access it is by using vf_format manually. Mind: This encoding uses full range values, not TV range.
@lvml I gave it a shot. May work, may blow up. (I haven't been able to access your test clip yet) Edit: Managed to grab a mirror of the test clip. Seems to display okay (as in: not obviously broken), but I don't really have anything to compare to so.. You can build bf335193 if you want to test it yourself. Use it like Also keep in mind that you can adjust the tone mapping with |
User request and not that hard. Closes mpv-player#3157. Note that FFmpeg doesn't support this and there's no signalling in HEVC etc., so the only way users can access it is by using vf_format manually. Mind: This encoding uses full range values, not TV range.
That looks extremely similar to what I see with just |
Oh, I think I know what's going on. mpv's stupid default behavior of “don't map colors/gamma unless the user specifies a target manually” is kicking in. For common spaces like BT.2020 we actually have a hard-coded exception to this “rule”, but for v-log/v-gamut there is no logic at all. The reason it looks fine for me is because I am using mpv with an icc profile configured (via Failing that, if you can estimate your target device's gamut and gamma, you can use mpv's built-in adaptation algorithms, e.g.: Edit: Also note that I found a bug that prevented the brightness adaptation from correctly working when not using an ICC profile; make sure to test with this fix applied, that is haasn@d192305. |
I also added v-log and v-gamut to the “wide gamut and HDR” blacklist for the default behavior, so it should just work with just the |
That logic exists mainly to not make mpv a special snow flake compared to other PC players when doing bt.601/bt.709, from what I remember. |
Yeah, exactly. It's a purely selfish decision, made to reduce bug reports in “common” cases at the expense of bad behavior in exceptional cases (like this). (Treating BT.601 as BT.709 on a BT.709 monitor is wrong behavior, but people compare mpv against every other player that also gets it wrong and then decide mpv is the one fucking it up) |
User request and not that hard. Closes mpv-player#3157. Note that FFmpeg doesn't support this and there's no signalling in HEVC etc., so the only way users can access it is by using vf_format manually. Mind: This encoding uses full range values, not TV range.
Great, works for me now (without additional saturation/brightness/gamma parameters): Adding Without "hdr-tone-mapping" the image loses some contrast and gets darker, but is still ok to look at. Using Thanks a lot again! |
Yes, those are pretty much the defaults now.
Yeah, (You should probably also set Edit: Nevermind, |
Encouraged by recent progress in issue #2572 "HDR video / SMPTE-ST-2084 support" I would like to ask for support of another electro-optical transfer function: V-Log, as supported by both consumer, "prosumer" and professional video cameras sold by Panasonic.
Such support would allow for immediate review of the files recorded by popular video cameras like the GH4R in V-Log mode, which allows to record at a higher dynamic range than the usual modes.
This would also allow to look at the material with correct luminance when "cutting in the compressed domain", as facilitated by https:/lvml/mpv-plugin-excerpt
I hope this is not much effort, given the transfer function formula in the specification, automatic detection of V-Log material is probably not required, as people reviewing material they shot on their own will probably know well they used V-Log mode ;-)
Here's a link to a few second short 116MB sample video recorded in V-Log mode, ProRes 422 HQ format (the blue download button is at the upper right of that page).
The text was updated successfully, but these errors were encountered: