m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/ffmpeg.md
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2023-05-07 00:46:19 +0200
committerMarcin Chrzanowski <m@m-chrzan.xyz>2023-05-07 00:46:19 +0200
commit495acba73ad4e8d4e41f870cdba21158b210bae0 (patch)
treefa36195009c66151023efa6153a1981e4b10ba28 /ffmpeg.md
parentad2e8de50a90fb109d57f20e28250d35c8d34fcb (diff)
Add ffmpeg A/V delay
Diffstat (limited to 'ffmpeg.md')
-rw-r--r--ffmpeg.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/ffmpeg.md b/ffmpeg.md
index 2d33ae4..b53621d 100644
--- a/ffmpeg.md
+++ b/ffmpeg.md
@@ -17,6 +17,15 @@ Works for audio, too.
# -1 means to automatically preserve aspect ratio
ffmpeg -i in.mp4 -filter:v scale=720:-1 out.mp4
+## Audio/video delay
+
+ ffmpeg -i "$input" -itsoffset <offset in seconds> -i "$input" -map 1:v -map 0:a -c:a copy -c:v libx264 "$output"
+
+For reverse offset, swap 1 and 0.
+
+Basically, take the input once with an offset, once without. Take the audio from
+one of them, video from the other.
+
## Rotate
# 90 degrees clockwise