Skip to main content

Calculate the cut needed at start to sync two media files.

Project description

SYNOPSIS

Command line help:

usage: stpl [-h] [--version] [-t TAKE] [-s] [-n] [-d] [-l LOWPASS] in1 in2

CLI interface to sync two media files using their audio streams.
  ffmpeg needs to be available.


positional arguments:
  in1                   First media file to sync with second, using audio.
  in2                   Second media file to sync with first, using audio.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -t TAKE, --take TAKE  Take X seconds of the inputs to look at. (default: 20)
  -s, --show            Turn off "show diagrams", in case you are confident.
  -n, --normalize       Turn on normalize. It turns on by itself in a second pass, if sampling rates
                        differ.
  -d, --denoise         Turns on denoise, as experiment in case of failure.
  -l LOWPASS, --lowpass LOWPASS
                        lowpass, just in case, because like with manual sync'ing, the low frequencies
                        matter more. 0 == off. (default: 0)

DESCRIPTION

The steps taken by syncstart:

  • extract start audio as .wav using ffmpeg

  • optionally normalize, denoise, lowpass the two .wav

  • compute offset via correlation using scipy ifft/fft

  • print result and optionally show in diagrams

Requirements:

  • ffmpeg installed

  • Python3 with tk (tk is separate on Ubuntu: python3-tk)

References:

Within Python:

from syncstart import file_offset file_offset

INSTALLATION

To install for user only, do:

pip install --user syncstart

EXAMPLES

syncstart from_s10.m4a from_gopro.m4p
syncstart from_s10.m4a from_gopro.m4p -t 10
syncstart from_s10.m4a from_gopro.m4p -t 30
syncstart from_s10.m4a from_gopro.m4p -sndl 0

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

syncstart-1.0.1-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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