-
-
Notifications
You must be signed in to change notification settings - Fork 56.3k
videoio/FFmpeg: increased packet read attempt limit, allow configuring it #23606
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asmorkalov
approved these changes
May 15, 2023
@opencv-alalek May I merge the patch? |
opencv-alalek
approved these changes
May 16, 2023
Merged
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
Jan 4, 2024
videoio/FFmpeg: increased packet read attempt limit, allow configuring it resolves opencv#9455 related opencv#3225 * Use different counters for wrong packets recieved by demuxer and errors from decoder * Allow modifying these counters via environment variables `OPENCV_FFMPEG_READ_ATTEMPTS`/`OPENCV_FFMPEG_DECODE_ATTEMPTS` * Added logging when reading breaks at one of error limits Notes: * I've been able to reproduce original issue with a video file with 14 total streams (video + audio + subtitles), at some point in the video only packets from the last stream are being sent by the demuxer, thus exceeding our limit. For my specific video total number of packets from wrong stream was about 2700. I've chosen 4096 as default value. * Default limit of decoding attempts is quite low, because I'm not sure in which cases it can be exceeded (network stream?). I tried to read 8k video from the disk, but it did not cause break at decode point.
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
videoio/FFmpeg: increased packet read attempt limit, allow configuring it resolves opencv#9455 related opencv#3225 * Use different counters for wrong packets recieved by demuxer and errors from decoder * Allow modifying these counters via environment variables `OPENCV_FFMPEG_READ_ATTEMPTS`/`OPENCV_FFMPEG_DECODE_ATTEMPTS` * Added logging when reading breaks at one of error limits Notes: * I've been able to reproduce original issue with a video file with 14 total streams (video + audio + subtitles), at some point in the video only packets from the last stream are being sent by the demuxer, thus exceeding our limit. For my specific video total number of packets from wrong stream was about 2700. I've chosen 4096 as default value. * Default limit of decoding attempts is quite low, because I'm not sure in which cases it can be exceeded (network stream?). I tried to read 8k video from the disk, but it did not cause break at decode point.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
resolves #9455
related #3225
OPENCV_FFMPEG_READ_ATTEMPTS
/OPENCV_FFMPEG_DECODE_ATTEMPTS
Notes: