https://bugs.kde.org/show_bug.cgi?id=527408
Bug ID: 527408
Summary: Audio/video misaligned in timeline for stream-copied
mkv (aligned in mpv, vlc and render)
Classification: Applications
Product: kdenlive
Version First 25.12.2
Reported In:
Platform: Debian stable
OS: Linux
Status: REPORTED
Severity: major
Priority: NOR
Component: Monitors & Playback
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
## Summary
A Matroska file cut with `ffmpeg -c copy` plays correctly in mpv and VLC, but
audio and video are sometimes misaligned in the Kdenlive project monitor. The
same file is aligned in the clip monitor, and a render of the misaligned
timeline comes out aligned. The misalignment is intermittent: with the same
file, it sometimes appears and sometimes doesn't.
## Files
- `piece_short2.mkv`: sample, created with the command below
- `piece_short2.md5`, `piece_short2.sha256`, `piece_short2.vstream.md5`:
checksums
- `control.mkv`: screen recording of the misalignment in the project monitor
(3.871 s offset)
- `kdenlive_alignment_issue.mp4`: another instance, which does not look like a
frozen frame (also posted at
https://www.reddit.com/r/kdenlive/comments/1x91iim/av_alignment_issue/)
- `project.kdenlive`: project showing the issue
can be downloaded at
https://drive.google.com/drive/folders/156yOLhmDE7PbSP-cafSSMexh7RzkGJhH?usp=drive_link
## How the file was made
ffmpeg -i "/mnt/stuff/video/casualties unknown/raw/2026-10-16_15-12-32.mkv" -ss
00:35:00 -to 00:35:30 -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c copy
./piece_short2.mkv
The source is a ~250 GB OBS recording (h264 1080p60 plus four AAC stereo
tracks). Because of the stream copy, the cut isn't frame-exact.
## Observations
- mpv, VLC, and Kdenlive's own render all show correct sync.
- With the larger piece, the offset in the Kdenlive timeline was about 21 s.
Once, with the file open in mpv at the same time, it was +2 min 25 s. In
`piece_short2.mkv` it is 3.871 s (see `control.mkv`).
- Starting Kdenlive from a terminal, the log shows `Stream with delay,
switching to MLT N` for each of the four audio streams during import. No errors
around the import.
- On one run I also saw `[matroska,webm] File ended prematurely` twice during
import. I haven't been able to tie it to the misalignment.
- Not reproducible on demand. After clearing the cache, restarting Kdenlive,
restarting the PC, and updating from 25.x to 26.08.2, the issue sometimes
appears and sometimes doesn't with the identical file. Other pieces cut the
same way show it too.
## Expected behavior
Audio and video stay in sync in the timeline, as they do in the clip monitor,
in mpv/VLC, and in the render.
## Workarounds and why they don't fit
1. Not cutting: the source is 250 GB and Kdenlive struggles with it.
2. Re-encoding the pieces: works, but it's a lot of overhead for a step an
editor should handle.
## System
- Kdenlive 26.08.2 (AppImage from kdenlive.org)
- Debian 13 (#!++), kernel 6.12.111, x86_64
--
You are receiving this mail because:
You are watching all bug changes.