Skip to main content

tacview-time-sync

This project aims to make it easier to synchronize tacview acmi tracks with recorded video files. It does this by calculating the correct video start timestamp relative to the track file.

The resulting video start timestamp can be added to the video filename, or this script can modify the file to add the timestamp as metadata. See https://tacview.fandom.com/wiki/Synchronized_Audio/Video_Playback for more information.

The goal is to determine the correct start time for the video, so that it aligns with the track.

  • In the illustration below, the tacview track file starts at 2020-10-01 at 10:00 am. This is the "tt" or track time expressed in ISO 8601 format. ex: "2020-10-10 10:00:00"
  • At 10 seconds after the track starts, an event occurs, perhaps a jet starts to taxi. This is the "td" or track delta expressed in minutes:seconds. ex: "0:10"
  • At 20 seconds after the video starts, the same event occurs. This is the "vd" or video delta expressed in minutes:seconds. ex: "0:20". The reason for the difference is that tracks and videos rarely start at the same time, but tacview needs to know how to align the 2 files.
  • To tell tacview when to start the video in reference to the track, we can include the video start timestamp in the filename or in the file metadata.
       tt = track start time, assume 2020-10-10 10:00:00 (this is the dcs mission time)
       |______________________________|
       |             td               |  << track file
       |______________________________|     track delta (td) the time into the track where the event occurs
    |____________________________________|
    |                vd                  |  << video file, usually starts before and ends after track
    |____________________________________|     video delta (vd) is the time into the video where the same event occurs
                     ^ = event delta, an event, like starting to taxi where you can see it in the track and video

Requirements

  • python3.6+

Installation

pip install tacview-timesync

Usage

$ tvts -h
usage: tvts [-h] [-v] -tt TRACK_EVENT_TIME -td TRACK_EVENT_DELTA -vd VIDEO_EVENT_DELTA [-vf VIDEO_FILE_NAME]

Calculate new video start timestamp from track start time, track event delta and video event delta

options:
  -h, --help            show this help message and exit
  -v, --verbose         increase output verbosity
  -tt TRACK_EVENT_TIME, --track-event-time TRACK_EVENT_TIME
                        Track absolute event time in ISO 8601 format (ex: "2010-10-01 10:00:00")
  -td TRACK_EVENT_DELTA, --track-event-delta TRACK_EVENT_DELTA
                        Track event time in minutes and seconds from track start (ex: "0:10")
  -vd VIDEO_EVENT_DELTA, --video-event-delta VIDEO_EVENT_DELTA
                        Video event time in minutes and seconds from video start (ex: "0:20")
  -vf VIDEO_FILE_NAME, --video-file_name VIDEO_FILE_NAME
                        optional video file name to which we will add metadata

Example Usage

To get the correct timestamp for a video file:

  1. Identify an event that you can see happen in the track file and in the video (i.e. start taxi)
  2. Determine the absolute time of the event in the track file (i.e. 2020-01-10 10:00:00).
  3. Then determine the offset time of the event in the track file (i.e. 0:10 into the video).
  4. Then determine the offset time of the same event in the video file(i.e. 0:20 into the video).
  5. Then run the following command to calculate the new video start timestamp:
    $ tvts -tt "2020-01-10 10:00:00" -td "0:10" -vd "0:20"
    new video start timestamp: 20200110T095950Z
    
  6. Add the new video start timestamp to the video file name (i.e. sockeye-dcs-20200110T095950Z.mp4)

To add the timestamp as metadata to a file, add the -vf argument:

$ tvts -tt "2020-01-10 10:00:00" -td "0:10" -vd "0:20" -vf sockeye-dcs.mp4
new video start timestamp: 20200110T095950Z
INFO:root:Adding metadata to file sockeye-dcs.mp4 - ['Media Created': '20200110T095950Z']

Developer Setup

Requirements

  • python3.6+
  • poetry

Setup

git clone https://github.com/peterb154/tacview-timesync.git
cd tacview-timesync
poetry install
make test

Metadata

Release files for tacview-timesync 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tacview-timesync 0.1.0
File Size Uploaded Provenance
tacview_timesync-0.1.0.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tacview-timesync 0.1.0
File Interpreter ABI Platform
tacview_timesync-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / tacview_timesync-0.1.0.tar.gz

Download URL tacview_timesync-0.1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ef512fb3a78d6660fe371cddb8389cab3cc629bd485e4c9f6d9b1a48c1ab8621
BLAKE2b-256 checksum
How to use checksums
fc6807eb6f4c266a5cab4e7aa9ceab9c1c09253495c3dd641fd3d90c51a0017a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Darwin/23.0.0

Release files / tacview_timesync-0.1.0-py3-none-any.whl

Download URL tacview_timesync-0.1.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dda2d8c8fc7ef193a65838fb5807417d7138a7b510a8eb66f815d5ec099dde2c
BLAKE2b-256 checksum
How to use checksums
5ca9ffe3bbd578993eb7f1dc53d4339ded3df15fbeb9285a21a271d3fdc44c84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Darwin/23.0.0

Security for tacview-timesync 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page