Skip to content

linux-v4l2: Skip corrupted H264/MJPEG frames during capture #12093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JiangXsong
Copy link

Description

This patch modifies the Linux v4l2-input plugin to improve the handling of H264 and MJPEG bulk mode streams. When encountering decoding errors, instead of terminating the capture thread, OBS will now skip the corrupted frame and continue capturing.

Motivation and Context

Receiving H264 or MJPEG video streams from UVC devices in bulk mode under Linux would frequently cause OBS to stop displaying video due to decoding errors. Skipping corrupted frames improves playback stability without needing to restart the capture.

How Has This Been Tested?

Tested with multiple UVC devices outputting H264 and MJPEG over bulk mode under Ubuntu 22.04. Confirmed that when corrupted frames occur, OBS logs the error but continues playback without interruption. Regular (non-bulk) streams and other input formats remain unaffected.

Types of changes

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

Checklist:

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

When receiving H264 or MJPEG video streams from UVC devices in bulk mode under Linux, OBS would frequently stop displaying video due to decoding error.

This patch modifies the behavior to skip corrupted frames instead of terminating rhe capture thread, allowing plackback to continue normally.
@JiangXsong JiangXsong force-pushed the fix-linux-v4l2-break branch from 61e5dff to e8b75ab Compare April 28, 2025 09:15
@RytoEX RytoEX requested a review from kkartaltepe April 28, 2025 20:53
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