Author Topic: logging and exporting electronic level data  (Read 1734 times)

elenhil

  • New to the forum
  • *
  • Posts: 38
logging and exporting electronic level data
« on: February 26, 2022, 07:13:59 PM »
I wonder if it is possible to log and export real-time electronic level data to a sidecar file, to possibly use it in postprocessing for stabilization purposes?

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8252

elenhil

  • New to the forum
  • *
  • Posts: 38
Re: logging and exporting electronic level data
« Reply #2 on: February 26, 2022, 08:05:04 PM »
Thanks a ton, Walter!

elenhil

  • New to the forum
  • *
  • Posts: 38
Re: logging and exporting electronic level data
« Reply #3 on: February 27, 2022, 08:33:18 AM »
Is there some additional setting I need to turn on (besides electronic level) to log this data? So far the log file inside my MLVs is empty.

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8252
Re: logging and exporting electronic level data
« Reply #4 on: February 27, 2022, 12:00:11 PM »
My settings:
Level enabled in ML overlay menu
MLV_REC allowed to use overlays
Preview option "Canon"

Extracted metadata with MLV_DUMP:
Code: [Select]
MLV_DUMP <myfile>.mlv -m -v

[...]
Block: ELVL
  Offset: 0x02733400
    Size: 32
    Time: 2257.355000 ms
     Roll:    3.00
     Pitch:   352.50
[...]

I hope roll and pitch are the one. Haven't used this before ...
EDIT: Excerpt from mlv_structure.h
Code: [Select]
typedef struct {
    uint8_t     blockType[4];    /* Electronic level (orientation) data */
    uint32_t    blockSize;
    uint64_t    timestamp;
    uint32_t    roll;    /* degrees x100 (here, 45.00 degrees) */
    uint32_t    pitch;    /* 10.00 degrees */
}  mlv_elvl_hdr_t;

ML700D

  • Member
  • ***
  • Posts: 147
Re: logging and exporting electronic level data
« Reply #5 on: February 27, 2022, 12:22:59 PM »
btw how to use in postprocessing?
EOS 700D

elenhil

  • New to the forum
  • *
  • Posts: 38
Re: logging and exporting electronic level data
« Reply #6 on: February 27, 2022, 01:42:34 PM »
My settings:
Level enabled in ML overlay menu
MLV_REC allowed to use overlays
Preview option "Canon"
I'm afraid I don't recognize the last two options. Could you please elaborate?

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8252
Re: logging and exporting electronic level data
« Reply #7 on: February 27, 2022, 01:46:05 PM »
Movie tab -> RAW video (MLV) -> [Q] ->
Global Draw: Allow
Preview Options: Canon

Don't know if these settings are necessary. I just wanted electronic level being visible during recording.

elenhil

  • New to the forum
  • *
  • Posts: 38
Re: logging and exporting electronic level data
« Reply #8 on: February 27, 2022, 02:04:22 PM »
Huh. Neither 60D nor 70D have the menu items under RAW video that you described. Oh, well. I do get the level displayed during recording anyway.

It's just that I can't find the level data. I had tried opening these MLVs with mlvfs, thinking these would be in log file inside. mlv_dump is new to me. I can't wrap my head around its structure. MLV_DUMP <myfile>.mlv -m -v seems to consist mostly of VIDF blocks. Is there a way to output just the ELVL blocks?

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8252
Re: logging and exporting electronic level data
« Reply #9 on: February 27, 2022, 02:06:31 PM »
You are using MLV_LITE instead of MLV_REC ...
And please make yourself familiar with mlv_lite specs: https://www.magiclantern.fm/forum/index.php?topic=16650.0
"1. Metadata is only for what the settings were when recording was started (e.g. you get expo metadata, but if you change exposure, you don't get that new information)."

elenhil

  • New to the forum
  • *
  • Posts: 38
Re: logging and exporting electronic level data
« Reply #10 on: February 27, 2022, 02:10:22 PM »
Genius! Thank you very much, Walter!