Skip to content

obs-outputs: File splitting improvements for Hybrid MP4/MOV#13386

Open
derrod wants to merge 2 commits intoobsproject:masterfrom
derrod:hybrid-do-not-drop-last-sample
Open

obs-outputs: File splitting improvements for Hybrid MP4/MOV#13386
derrod wants to merge 2 commits intoobsproject:masterfrom
derrod:hybrid-do-not-drop-last-sample

Conversation

@derrod
Copy link
Copy Markdown
Member

@derrod derrod commented May 2, 2026

Description

Fixes file splitting by ensurnig the last frame of each part is not dropped, and b-frames are accounted for in the timer

Motivation and Context

Address part of #13374.

Originally, before file splitting was introduced, I made the choice to simple ignore the last frame in the packet queue of the muxer, because frame N+1 is required to properly determine the duration and I figured nobody would notice if their recording is one frame short.

However, when using frame splitting this would result in the last frame before a split being dropped. To fix this, we can simply reuse the previous sample's duration for the final sample in a file. Since OBS only does CFR, they should all be identical anyway.

Additionally I discovered while testing that the first split would always be one GOP too long (e.g. 1m2s instead of 1m) due to the fact that b-frames and negative start DTSes were not accounted for. This is also fixed in this PR.

How Has This Been Tested?

Recorded some files, looked at them frame-by-frame to confirm none are missing now.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@derrod derrod added the kind/bug Categorizes issue or PR as related to a bug. label May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant