Skip to main content

Extract geotagged still frames from DJI videos and their SRT telemetry

Project description

srtgeotag

srtgeotag extracts still frames from drone video and embeds the matching DJI SRT telemetry in each image. It works as both a Python library and a command-line tool.

Features

  • Single videos, multiple videos, or every video in a directory
  • Automatic same-name SRT discovery, including .SRT on case-sensitive systems
  • Sampling by frames per second or by time interval
  • JPEG, PNG, and WebP output
  • Standard EXIF GPS, altitude, capture time, ISO, exposure, aperture, and focal length
  • Complete telemetry preserved as compact JSON in EXIF ImageDescription and UserComment
  • Fast, single-pass extraction with FFmpeg; no ExifTool or source-FPS argument required
  • Live progress bars for frame extraction and EXIF telemetry tagging

Requirements and installation

Install FFmpeg and make sure ffmpeg is on PATH, then:

pip install srtgeotag

For local development:

python -m pip install -e ".[dev]"

To install directly from a downloaded or cloned project folder:

cd srtgeotag
python -m pip install .
srtgeotag --version

CLI

The SRT is found beside each video by matching its filename stem.

# One frame per second
srtgeotag DJI_0001.MP4 -o frames --fps 1 --format jpg

# One frame every two seconds
srtgeotag DJI_0001.MP4 -o frames --interval 2 --format png

# Several files (each gets its own subdirectory)
srtgeotag DJI_0001.MP4 DJI_0002.MP4 -o frames --fps 0.5

# Every supported video in a directory
srtgeotag ./flight -o frames --interval 5

Use --overwrite to replace existing numbered images. Progress is displayed by default; use --no-progress when running in scripts or CI. Run srtgeotag --help for all options.

Python API

from srtgeotag import extract_video, extract_videos, parse_srt

result = extract_video(
    "DJI_0001.MP4",
    "frames",
    fps=0.5,                 # one image every two seconds
    image_format="jpg",
)
print(result.frames)

telemetry = parse_srt("DJI_0001.SRT")
print(telemetry[0].latitude, telemetry[0].longitude)

extract_video() accepts srt=... for an explicitly named subtitle and ffmpeg=... for a custom executable path. extract_videos() uses a separate subdirectory for each video when processing a batch.

Telemetry mapping

Each output image is matched to the nearest SRT record using elapsed video time. This avoids accumulated timing errors for fractional rates such as 29.97 fps. Latitude, longitude, absolute altitude, capture time, ISO, shutter/exposure time, aperture, exposure bias, and focal length use standard EXIF fields. DJI-only values such as relative altitude, color mode, and color temperature remain available in the embedded JSON payload.

License

MIT

About AutoWaypoints.com

This project is open-sourced by AutoWaypoints.com, a DJI drone mission-planning platform for automated mapping, photogrammetry, 3D capture, and Gaussian splatting workflows.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srtgeotag-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

srtgeotag-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file srtgeotag-0.1.0.tar.gz.

File metadata

  • Download URL: srtgeotag-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for srtgeotag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b6d78c5f8440414242bb320c5e52e5e0f9b278044f151859374dfe10fca6cb9
MD5 c4a44a00c826a004c38905a207f575c9
BLAKE2b-256 1a1d21754bcae69042b20d9af85a980ba3014d8e6b3d85b5968cd0e955774c3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for srtgeotag-0.1.0.tar.gz:

Publisher: release.yml on GrishTad/srtgeotag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file srtgeotag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: srtgeotag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for srtgeotag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb48e2b8149d903db6cc83af44a01bf8eb20d20eb8b17ca4b1a695a2a6c3922a
MD5 f44552c2ee73f6baf3d650463ff3467f
BLAKE2b-256 22b6897214247f31d2f4967826ab940b3adaeb1b107df070b78787f6cc48dd6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for srtgeotag-0.1.0-py3-none-any.whl:

Publisher: release.yml on GrishTad/srtgeotag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page