From 442e2b0d88235dd1170691f8d8c21c3b8f7ab439 Mon Sep 17 00:00:00 2001 From: gutmet Date: Wed, 17 Feb 2021 10:20:11 +0100 Subject: [PATCH] script for delaying audio in a video --- delayaudio | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 delayaudio diff --git a/delayaudio b/delayaudio new file mode 100755 index 0000000..294ef31 --- /dev/null +++ b/delayaudio @@ -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"