Skip to content

Audio tracks synchronization command-line tool for video editors that don't support it

License

Notifications You must be signed in to change notification settings

feanor3/sync-audio-tracks

 
 

Repository files navigation

Sync Audio Tracks

This code is based on Miles McCoo's cross-correlation implementation. It calculates a delay between two audios and produces a shifted audio.

Known Limitations

Paths with spaces and weird characters are unsupported.

Supported Formats

They depend on how SoX and FFmpeg were built for your OS (more details). If it didn't work with some format for you — try WAV as experiment.

Installation

Make sure these dependences are installed:

  • bash (tested with 4.4.23)
  • bc (tested with 1.06.95)
  • ffmpeg (tested with 4.1.3)
  • fftw (tested with 3.3.6_p2)
  • libsndfile (tested with 1.0.28)
  • python3 (tested with 3.6.10)
  • sox (tested with 14.4.2)

On Debian some packages may need to be installed together with -dev packages (for instance fftw with fftw-dev).

Now compile it with

make -j

Usage

./sync-audio-tracks.sh good_audio_from_recorder.wav bad_audio_from_camera.wav out.wav 900

In this example

  • out.wav is a shifted version of good_audio_from_recorder.wav
  • 900 is sound duration limit for analysis (in seconds)

License

Apache 2.0

Copyright (C) 2018—2020 Alexander Lopatin

About

Audio tracks synchronization command-line tool for video editors that don't support it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 37.7%
  • Python 33.0%
  • Shell 23.6%
  • Makefile 5.7%