ReproNim / reprostim

Automated capture of audio-visual stimuli into BIDS datasets
5 stars 3 forks source link

Add iso format timestamp to the .mkv.log header #99

Closed yarikoptic closed 4 months ago

yarikoptic commented 5 months ago

ATM

❯ grep REPROSTIM-METADATA-JSON.*start_ts 2024.05.28.11.08.50.176_2024.05.28.11.10.31.855.mkv.log
2024-05-28 11:08:50.177 [info] [3719071] REPROSTIM-METADATA-JSON: {"aDev":"hw:2,1","appName":"reprostim-videocapture","cx":1920,"cy":1080,"frameRate":"60","serial":"B208220302195","start_ts":"2024.05.28.11.08.50.176","ts":"2024.05.28.11.08.50.177","type":"session_begin","vDev":"USB Capture DVI+","version":"1.8.0.225"} :REPROSTIM-METADATA-JSON
vmdocua commented 5 months ago

For all timestamps in metadata JSON log were added new property ending with "_iso" suffix, e.g. "start_ts_iso", "ts_iso", etc. There is no timezone - we expect it's server one, and precision is microseconds rather than milliseconds. Log sample listed below:

2024-06-21 14:39:10.090 [INFO] [10050] REPROSTIM-METADATA-JSON: {"aDev":"hw:1,1","appName":"reprostim-videocapture","cx":1920,"cy":1080,"frameRate":"60","serial":"B208220302154","start_ts":"2024.06.21.14.39.10.089","start_ts_iso":"2024-06-21T14:39:10.089241","ts":"2024.06.21.14.39.10.090","ts_iso":"2024-06-21T14:39:10.090373","type":"session_begin","vDev":"USB Capture DVI+","version":"1.10.0.250d"} :REPROSTIM-METADATA-JSON
yarikoptic commented 4 months ago

Let's make it uniform with https://github.com/ReproNim/reprostim/pull/102/files#r1672690352 in having _start the last one, and here since we differentiate between "cap" (for "capture") and record itself (thus called it "json") - prefix with it to

cap_ts_start, json_ts_start, cap_isotime_start, json_isotime_start

ie. common format to be

{subject}_{type of time + possibly format}_{start,end}

whenever we do not mention {subject}_ if it is obvious, like in QrRecord we have them all about qr record so no need to explicitly list.