script for delaying audio in a video

master
gutmet 2021-02-17 10:20:11 +01:00
parent 8f1a0d983e
commit 442e2b0d88
1 changed files with 18 additions and 0 deletions

18
delayaudio Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# delay the audio by using the same video file as two inputs
# for ffmpeg, one offset by $1 seconds. Take the video of the
# first, the audio of the offset one. Negative offsets are ok.
set -eu
if [ "$#" -ne 2 ]; then
echo "USAGE: $0 DELAY FILE"
exit 1
fi
fullpath="$2"
source fileextensions
cd "$dir"
ffmpeg -i "$filename.$extension" -itsoffset "$1" -i "$filename.$extension" -map 0:v -map 1:a -c copy "$filename""_delayed.$extension"