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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file syncstart-1.0.1-py3-none-any.whl.
File metadata
- Download URL: syncstart-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93f96c89c28c896823a258412732cfd852f6755d8ff253fe28befd55f9da4c7d
|
|
| MD5 |
7d7d2dd1528fd79883b1187d02cab242
|
|
| BLAKE2b-256 |
967a985e2d99f9177e5f55e9f3dcae63e9d2daf5746bc31b45d9074aba0e35c0
|