Skip to content

Fix remux examples dropping keyframes with no DTS#2290

Merged
WyattBlue merged 2 commits into
mainfrom
patch
Jun 7, 2026
Merged

Fix remux examples dropping keyframes with no DTS#2290
WyattBlue merged 2 commits into
mainfrom
patch

Conversation

@WyattBlue
Copy link
Copy Markdown
Member

No description provided.

The remux examples skipped demux's flushing packet with `packet.dts is
None`. That assumption is wrong: a valid keyframe can demux with no DTS
(e.g. the leading reordered packets of a B-frame stream in a PTS-only
container like MKV). For such files the keyframe was dropped, producing
an undecodable video that only played the audio.

Skip the empty flushing packet with `packet.size == 0` instead, and
apply the same fix to the remux loops in the test suite. Adds a
regression test that encodes a B-frame MKV (whose first packet is a
keyframe with no DTS) and asserts the remux keeps it.
@WyattBlue WyattBlue merged commit 5f5535c into main Jun 7, 2026
7 checks passed
@WyattBlue WyattBlue deleted the patch branch June 7, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant