DJI Avata 360: D-Log M curve (--fit avata360) and its colour mode field - #1
Conversation
Adds kDlogMAvata360 and kNativeToRec2020_Avata360, selectable as --fit avata360 in osvtool render and osvtool lut. DJI publishes no Avata 360 LUT, so both were fitted to DJI Studio's export of one Avata 360 D-Log M clip, in the same 7-parameter form and with the same constraints as kDlogMOsmo360. Method, held-out result and limits are in the comment on kDlogMAvata360 and in docs/COLOR.md. Osmo 360 stays the default; DlogMFit::Avata360 is appended as 3. The Avata 360 (dvtm_AVATA360.proto) records its colour mode at StreamMeta 2.4.1, and its StreamMeta 4 is empty, so every Avata clip read as Normal. DjmdDecoder now reads 2.4.1 for that proto: 19 is D-Log M, an empty 2.4 is Normal, anything else is left Unknown with a warning. Verified on macOS (Homebrew deps, CPU only): all unit tests pass except the FFmpeg LGPL check, which fails the same way before this change because Homebrew's FFmpeg is a GPL build. [sample] tests skipped. osvtool probe on three Avata 360 clips (two D-Log M, one Normal) and two Osmo 360 clips reports the recorded mode for each.
|
Nice work, I read through the code and looks good, will test a build out in the morning and then merge this in. Thanks for the contribution! |
|
Also a note, if you can record some footage with a brightly lit room and a color reference card, you may be able to get your own calibration data. It was strange for me but the references I used from DJI to convert D Log M to Rec 709 are identical for both the Osmo 360 and Pocket 3. In fact the LUT is originally from an older device.. I did something very similar and used some test footage, tried maybe 9 different methods, until I found the result that gave the most true to life look on my calibrated monitor and just set that as the default. I settled on the ACES 2.0 color space, based on the DJI references. Gaussian splats are very cool. I actually considered trying to do stitching with them for the seams, but didn’t get any results that were worth the speed trade off. |
|
The Avata 360's metadata layout uses different field numbers for colour mode, calibration, and focal length than the Osmo's, which is why its calibration looked missing. Fixing this and maybe even adding stitching support |
|
Yes, it's different. I can share osv + srt file along with mp4 stitched together by dji studio? I switched both my lens as they scratched, with official replacement ones - I have to do panaromic calibration before I capture this for you. Please tell me how I can share these files privately with you? |
Thank you for OpenOSV. We ported your Osmo 360 D-Log M curve and primaries matrix into spirula-studio, a Gaussian splatting trainer (harry7557558/spirula-studio#97). The fit write-ups in
DlogM.handMatrices.hmade that easy. This PR gives back what we learned on the DJI Avata 360, which also records.OSV.What it adds
--fit avata360inosvtool renderandosvtool lut.kDlogMAvata360uses the same 7-parameter form and constraints askDlogMOsmo360.kNativeToRec2020_Avata360has rows that sum to 1. Osmo 360 stays the default.DlogMFit::Avata360is appended as 3.dvtm_AVATA360.protothe decoder now reads 2.4.1. 19 is D-Log M and an empty 2.4 is Normal. Anything else stays Unknown with a warning, since no sample has shown it.How the curve was derived
DJI publishes no D-Log M LUT for the Avata 360. So we fitted one from our own footage. We used an Avata 360 D-Log M clip and DJI Studio's export of the same clip with its D-Log M conversion applied. A Normal clip and its export set the noise floor.
BT.709 OETF(2^e * M709 * M * lin(code)). The exposureeis fitted separately and kept out of the curve, so code 0.4 still maps to 0.18.Held-out error, median 8-bit display levels (R / G / B):
osmo360curve and matrixavata360curve and matrixMethod check: the same procedure on an Osmo 360 clip and its DJI Studio export lands within 0.045 stops of your
kDlogMOsmo360for codes 0.15 to 0.50. It drifts to 0.22 stops dark at code 0.8.Limits
osmo360.No footage and no DJI output is included. Only the 16 constants are. NOTICE,
docs/LEGAL.mdsection 5 anddocs/COLOR.mdhave entries.Tests and verification
Avata 360 D-Log M curve and primaries, andThe Avata 360 colour mode is read from StreamMeta 2.4 and not from 4. The Avata curve and matrix were also added to the existing monotonic, round-trip and white-preservation loops.FindFFMPEGand tinyexr, which are not part of this PR.ctest: 395 of 396 pass. The one failure,FFmpeg build is LGPL and reports its version, fails the same way before this change, because Homebrew's FFmpeg is a GPL build. I did not run the[sample]tests, since I do not have your sample clip. I did not build Windows, CUDA or the plug-ins.osvtool probeon three Avata 360 clips now reports D-Log M, D-Log M and Normal, as recorded. Two Osmo 360 clips (one D-Log M, one Normal) read the same as before.Things you may want to know
osvtool probefinds no calibration on Avata 360 clips. Their PanoDewarpParams-like message appears at StreamMeta field 5 rather than 6. So Avata stitching does not work yet. This PR does not try to fix that. The curve is still usable throughosvtool lut --fit avata360.avata360to the Premiere and Resolve curve menus (PrefsDlogmFit). That would touch the persisted preferences and the UI, so it seemed your call.Please change or drop anything you would rather do differently. You know this code far better than we do. Thanks again.