Skip to main content

A tool to determine the offset between videos from two jointly mounted GoPros based on a combination of audio, accelerometer, and gyroscope data.

Project description

GoPro Video Sync

A tool to determine the offset between videos from two jointly mounted GoPros based on a combination of audio, accelerometer, and gyroscope data.

Installation

Install gopro-video-sync from PyPI:

pip install gopro-video-sync

Or from the source on GitHub:

pip install "gopro-video-sync @ git+https://github.com/evoth/gopro-video-sync"

The package will be installed with the module name gopro_video_sync.

Usage example

Print the required adjustment to sync videos from two jointly mounted GoPros:

from gopro_video_sync import gopro_offset

video_1 = "GOPR1569.MP4"
video_2 = "GOPR0105.MP4"

offset, source_1, source_2 = gopro_offset(video_1, video_2)

if offset is None:
    print("Could not determine offset between the given videos.")
else:
    offset = round(offset, 3)
    if offset > 0:
        print(f"Trim the first {offset} seconds of {video_1} to sync the videos.")
    elif offset < 0:
        print(f"Trim the first {-1 * offset} seconds of {video_2} to sync the videos.")
    else:
        print("Videos are already synced.")

How it works

Since I had wanted to sync videos from two GoPros that were mounted together, I realized that the gyroscope and accelerometer information from each should be identical. GoPros store sensor data inside MP4 files in a format called GPMF, developed by GoPro for this very purpose. So, this program extracts the GPMF data from each video file and uses cross-correlation to attempt to line up the videos.

If the individual offsets obtained from the gyroscope and accelerometer data do not agree, then the audio data is used in an attempt to verify one of the sensor offsets. If this does not work, then the offset can not be determined.

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

gopro-video-sync-0.0.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

gopro_video_sync-0.0.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file gopro-video-sync-0.0.3.tar.gz.

File metadata

  • Download URL: gopro-video-sync-0.0.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for gopro-video-sync-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3fe0f714989d0b1cc2fa8f0c3555cdfbdfad2c1029c74105d88c48bf3e5c6270
MD5 68cee75f946004ea94d59c2076637e49
BLAKE2b-256 c2552aee105865ea75175d1fb50d525b38a9b977934c22d4a4e7e4dc4cd4ac6e

See more details on using hashes here.

File details

Details for the file gopro_video_sync-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gopro_video_sync-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ba493da6fc97a87414dc45a6c34fef08f2f963c3d16d2e5f0ae8badb77964859
MD5 07132be7bda62ca7ab5ea2e5c3b9a321
BLAKE2b-256 53870256c5ba33fc9405ad5976744b81cbb600e635415ba8b2dc5d9078bfffa9

See more details on using hashes here.

Supported by

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