This script synchronizes video and audio files using ffmpeg
and performs automatic synchronization using audio signal analysis. It can delay or advance the audio to match the video based on the specified parameters.
- Synchronize video and audio files with options to delay or advance the audio.
- Automatic synchronization using audio signal analysis.
- Extract and adjust audio tracks.
- Maintain existing metadata for audio and subtitles.
- Option to specify synchronization in seconds for precise control.
- Progress indicator for the synchronization process.
- Python 3.x
ffmpeg
ffprobe
- Python libraries:
numpy
,librosa
,scipy
,tqdm
-
Install
ffmpeg
andffprobe
:- You can download from ffmpeg.org and follow the installation instructions for your operating system.
-
Clone this repo
git clone https://github.com/fe80Grau/charlyeditor.git
-
Go to charlyeditor folder
cd charlyeditor
-
Install the required Python libraries:
pip install -r requirements.txt
python charly_gui.py
Synchronize video and audio with automatic synchronization:
python charly.py --main_file "<path_to_main_video>.mkv" --audio_file "<path_to_audio_file>.mkv" --use_auto_sync
Synchronize video and audio with a specified delay or advance in seconds:
python charly.py --main_file "<path_to_main_video>.mkv" --audio_file "<path_to_audio_file>.mkv" --seconds <number_of_seconds> --audio_delay <delay|advance>
--main_file
(required): The main file that will contain the final video, audio, and subtitles.--audio_file
(required): The secondary file from which the additional audio will be extracted.--audio_delay
(default:delay
): Whether to delay ('delay'
) or advance ('advance'
) the audio to synchronize.--output_file
(optional): Name of the output file.--seconds
(optional): Seconds to use for advancing or delaying the audio.--use_auto_sync
(flag): Use automatic audio synchronization based on audio signal analysis.
python charly.py --main_file "D:\downloads\[CR] VINLAND SAGA - S01E01 [1080p].mkv" --audio_file "D:\downloads\VINLAND SAGA_S01E01_Episodio 1.mkv" --use_auto_sync
python charly.py --main_file "D:\downloads\[CR] VINLAND SAGA - S01E01 [1080p].mkv" --audio_file "D:\downloads\VINLAND SAGA_S01E01_Episodio 1.mkv" --seconds 15.99 --audio_delay advance
If --seconds
is not provided, the script will use the difference in duration between the media files for use in the delay or advance.
Example:
python charly.py --main_file "D:\downloads\[CR] VINLAND SAGA - S01E01 [1080p].mkv" --audio_file "D:\downloads\VINLAND SAGA_S01E01_Episodio 1.mkv" --audio_delay advance
The script will output the synchronized video file at the specified location.
Output file saved as D:\downloads\Telegram Desktop\[CR] VINLAND SAGA - S01E01 [1080p]_edited.mkv
This project is licensed under the MIT License - see the LICENSE file for details.