From 5dc7425d448145bada4dfa4ad923fdcf315b0c55 Mon Sep 17 00:00:00 2001 From: Vadim Melnik Date: Tue, 16 Jul 2024 16:31:49 +0300 Subject: [PATCH] Normalize videocapture metadata JSON logs according to this suggestion: https://github.com/ReproNim/reprostim/issues/99#issuecomment-2221090283, #99 --- Capture/version.txt | 2 +- Capture/videocapture/src/VideoCapture.cpp | 28 +++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Capture/version.txt b/Capture/version.txt index 72fd1c7f..bff34771 100644 --- a/Capture/version.txt +++ b/Capture/version.txt @@ -1 +1 @@ -1.11.0.258 \ No newline at end of file +1.11.0.261 \ No newline at end of file diff --git a/Capture/videocapture/src/VideoCapture.cpp b/Capture/videocapture/src/VideoCapture.cpp index 6eba4577..766c1b0e 100644 --- a/Capture/videocapture/src/VideoCapture.cpp +++ b/Capture/videocapture/src/VideoCapture.cpp @@ -138,11 +138,11 @@ void FfmpegThread ::run() { Timestamp ts = CURRENT_TIMESTAMP(); json jm = { {"type", "session_end"}, - {"ts", getTimeStr(ts)}, - {"ts_iso", getTimeIsoStr(ts)}, + {"json_ts", getTimeStr(ts)}, + {"json_isotime", getTimeIsoStr(ts)}, {"message", "ffmpeg thread terminated"}, - {"start_ts", getParams().start_ts}, - {"start_ts_iso", getTimeIsoStr(getParams().tsStart)} + {"cap_ts_start", getParams().start_ts}, + {"cap_isotime_start", getTimeIsoStr(getParams().tsStart)} }; _METADATA_LOG(jm); _SESSION_LOG_END_CLOSE_RENAME(outVideoFile2 + ".log"); @@ -187,13 +187,13 @@ void VideoCaptureApp::onCaptureStop(const std::string& message) { Timestamp ts = CURRENT_TIMESTAMP(); json jm = { {"type", "capture_stop"}, - {"ts", getTimeStr(ts)}, - {"ts_iso", getTimeIsoStr(ts)}, + {"json_ts", getTimeStr(ts)}, + {"json_isotime", getTimeIsoStr(ts)}, {"message", message}, - {"start_ts", start_ts}, - {"start_ts_iso", getTimeIsoStr(tsStart)}, - {"stop_ts", stop_ts}, - {"stop_ts_iso", getTimeIsoStr(tsStop)} + {"cap_ts_start", start_ts}, + {"cap_isotime_start", getTimeIsoStr(tsStart)}, + {"cap_ts_stop", stop_ts}, + {"cap_isotime_stop", getTimeIsoStr(tsStop)} }; _METADATA_LOG(jm); @@ -342,15 +342,15 @@ void VideoCaptureApp::startRecording(int cx, int cy, const std::string& frameRat Timestamp ts = CURRENT_TIMESTAMP(); json jm = { {"type", "session_begin"}, - {"ts", getTimeStr(ts)}, - {"ts_iso", getTimeIsoStr(ts)}, + {"json_ts", getTimeStr(ts)}, + {"json_isotime", getTimeIsoStr(ts)}, {"version", CAPTURE_VERSION_STRING}, {"appName", appName}, {"serial", targetVideoDev.serial}, {"vDev", targetVideoDev.name}, {"aDev", targetAudioInDev.alsaDeviceName}, - {"start_ts", start_ts}, - {"start_ts_iso", getTimeIsoStr(tsStart)}, + {"cap_ts_start", start_ts}, + {"cap_isotime_start", getTimeIsoStr(tsStart)}, {"cx", cx}, {"cy", cy}, {"frameRate", frameRate}