I want to extract an aligned audio stream from a video. The goal is to obtain an audio sequence that is precisely aligned with the video.
Issue: The video and audio sequences are not aligned. The output audio duration is shorter than the video input.
Script to reproduce:
fn=TV-20200617-2242-4900.websm.h264
url=https://download.media.tagesschau.de/video/2020/0617/$fn.mp4
wget -nc $url
ffmpeg -y -i "$fn.mp4" -vsync 1 -async 1 -map 0:a "$fn.wav" -map 0:v "$fn.flv"
ffprobe -i $fn.mp4 # Duration: 00:01:51.68
ffprobe -i $fn.flv # Duration: 00:01:51.68
ffprobe -i $fn.wav # Duration: 00:01:49.61
What I have tried (without success):
- Adding
-async 1
as suggested in this answer. - Adding
-acodec copy
and exporting the video at the same time (link). - Opening the
mp4
in Audacity. The duration there is00:01:49.61
. - Opening the
mp4
in VLC. Duration:00:01:51.68
. - Explicitly setting the framerate.
- Other video files.
ffmpeg version 4.2.4-1ubuntu0.1
I would appreciate any hint on how to make this work. Thank you.