Audio Video Align Tool on the command line @bwack
Audio Video Align Tool on the command line  @bwack
Uploaded February 2021 | Updated November 2026, 2 days ago
This method is for the computer savvy. It was done on Ubuntu/Linux, however I think the script will run on windows as well. ffmpeg is also on windows.

I use ffpmpeg to replace audio in videos, and a script found here for finding the exact amount to trim the video to align audio to video.
github.com/align-videos-by-sound/align-videos-by-sound

the ffmpeg commandline:
ffmpeg -ss 00:00:03.1147 -i video.mp4 -i audio.wav -map 0:v:0 -map 1:a:0 -c:v copy -y video_with_audio_replaced.mp4'


for camera audio, my left channel is bad, so I use this script to replace the audio with only the audio from the right channel:
#!/bin/bash

for vid in VID*.mp4; do
#ffmpeg -i "$vid" -map_channel 0.1.1 -c:v copy "${vid%.mp4}_mono.mp4"
ffmpeg -i "$vid" -map_channel 0.1.1 -filter:a loudnorm -c:v copy "${vid%.mp4}_mono.mp4"
done
Audio Video Align Tool on the command lineAttempting to repair my Denon PMA 1500R-  Pt.1C64C 250469 replica PCB Prototype - part 3Videopac Arduino-SD cartridgeG7000 RAM Cart by Sören Gust preview - boards supplied by elecrowMechBoard64 build part1Assembling the relay board (Amp Switch Automatic)Trying out the Andonstar ADSM302 digital microscopeC64C Motherboard KiCad Replica update 4C64C Motherboard KiCad Replica update 2Amp Switch Automatic - All put togetherDads AmpSwitchAutomatic in Action and other Tandberg HIFI goodies
bwack |

Audio Video Align Tool on the command line

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER