Skip to content

fix: avoid dropping frames before H.264 decoding#904

Open
Woodii1998 wants to merge 2 commits intolichtblick-suite:developfrom
Woodii1998:fix/h264Renderable
Open

fix: avoid dropping frames before H.264 decoding#904
Woodii1998 wants to merge 2 commits intolichtblick-suite:developfrom
Woodii1998:fix/h264Renderable

Conversation

@Woodii1998
Copy link
Copy Markdown
Contributor

User-Facing Changes

Fixes incorrect video output when playing H.264 streams at high speed or with long GOP intervals by ensuring frames are not filtered out before decoding.


Description

Currently, some frames are filtered out before being passed to the WebCodecs decoder.
This breaks H.264 decoding because inter frames depend on previous reference frames, which can lead to visual corruption, especially when:

  • Playing at high playback speed
  • The key frame (IDR) interval is large

This PR removes the pre-decode frame filtering logic and always feeds a complete frame sequence into the decoder, ensuring correct reference frame handling and stable playback for compressed video streams.

You can reproduce the issue using the file below by playing it at 5× speed.

https://drive.google.com/file/d/1z6PnopbkXyMWdln4h-u5rIw_p1pB6v15/view?usp=drive_link

Additionally, this PR removes a duplicated condition check inside an if statement to simplify the logic and improve code clarity.


I also wanted to ask: is there any plan to support H.265 (HEVC) decoding in this project?
If so, I would be happy to help contribute support for it.

Checklist

  • The web version was tested and it is running ok
  • The desktop version was tested and it is running ok
  • This change is covered by unit tests
  • Files constants.ts, types.ts and *.style.ts have been checked and relevant code snippets have been relocated

@rodrigo-rodrigues-ctw
Copy link
Copy Markdown
Contributor

Hi @Woodii1998, we'll take a look at this when appropriate.
Thank you for you contribution.

Regarding the H.265 (HEVC) decoding, it's not something we're actively looking into, so definitely have a go at it if you'd like.
We'll support your efforts.
Cheers

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.

2 participants