linux-v4l2: Skip corrupted H264/MJPEG frames during capture #12093
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist: