mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-30 17:35:37 -04:00
Adds a new boolean config option ZM_OPT_EXPORT_TIMESTAMP_TRACK (default off, category web). When enabled, the multi-event MP4 download path in web/includes/download_functions.php walks the sorted event list, accumulates one WebVTT cue per second mapping the concat-relative time to the source event's wall-clock StartDateTime, writes timestamps.vtt next to event_files.txt, and muxes it into the merged output as a mov_text subtitle stream alongside the existing -c copy of video and audio. Also stamps an MP4-level creation_time set to the earliest event start (UTC ISO-8601). Off behavior is byte-identical to before: same ffmpeg -f concat -safe 0 -i event_files.txt -c copy <out>.mp4. Helpers formatVttTimestamp / buildVttContent / writeVttFile added at the bottom of download_functions.php and unit-smoke-tested via php -r. Falls back to (EndDateTime - StartDateTime) when an event's Length is null/0; if neither is usable the cues for that event are skipped with a debug log so the export still completes. The subtitle stream is intended as a machine-readable record of capture time per second, replacing the need to OCR the burned-in OSD timestamp. mov_text is rendered by VLC and Safari and ignored by browsers' <video> element without an explicit <track>; tools can extract cues with `ffmpeg -map 0:s -f srt -` or read them via `ffprobe -show_streams`. refs #4761 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>