• M
    Merge pull request #23606 from mshabunin:fix-ffmpeg-packet-limit · 001a2c51
    Maksim Shabunin 提交于
    videoio/FFmpeg: increased packet read attempt limit, allow configuring it
    
    resolves #9455
    related #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.
    001a2c51
cap_ffmpeg_impl.hpp 97.6 KB