VideoCapture: fix opencv/contrib/#3474#23541
Conversation
| { | ||
| filterName = eVideoCodec == CV_CODEC(CODEC_ID_H264) ? "h264_mp4toannexb" : "hevc_mp4toannexb"; | ||
| } | ||
| filterName = eVideoCodec == CV_CODEC(CODEC_ID_H264) ? "h264_mp4toannexb" : "hevc_mp4toannexb"; |
There was a problem hiding this comment.
AFAIK, there are some H264/H265 streams which are already "filtered" (applying again filtering looks strange).
Details: #15290 (comment)
Perhaps we need to recheck "raw" .h264 files that they are not broken.
(tests are failed on CI)
There was a problem hiding this comment.
(tests are failed on CI)
I suspect this may a threading issue related to setting up the bitstream filter for more files when using the version of FFmpeg on the old build bot (56.60.100) because it is less than < 58.9.100 where threading support was enabled by default.
2017-12-26 - a04c2c707d - lavc 58.9.100 - avcodec.h
Deprecate av_lockmgr_register(). You need to build FFmpeg with threading
support enabled to get basic thread-safety (which is the default build
configuration).
There was a problem hiding this comment.
AFAIK, there are some H264/H265 streams which are already "filtered" (applying again filtering looks strange).
We could use the approach adopted in the Nvidia Video Codec SDK samples,
bMp4H264 = eVideoCodec == AV_CODEC_ID_H264 && (
!strcmp(fmtc->iformat->long_name, "QuickTime / MOV")
|| !strcmp(fmtc->iformat->long_name, "FLV (Flash Video)")
|| !strcmp(fmtc->iformat->long_name, "Matroska / WebM")
);
bMp4HEVC = eVideoCodec == AV_CODEC_ID_HEVC && (
!strcmp(fmtc->iformat->long_name, "QuickTime / MOV")
|| !strcmp(fmtc->iformat->long_name, "FLV (Flash Video)")
|| !strcmp(fmtc->iformat->long_name, "Matroska / WebM")
);
which uses the long_name to determine whether we are dealing with a container format or not. The assumption being that container formats are length prefixed and raw files/streams are code prefixed.
What do you think?
There was a problem hiding this comment.
@opencv-alalek updated to use the approach found in the Nvidia Video Codec SDK samples.
Fix opencv/contrib/#3474 by allowing the bitstream filter to be applied to all h264/5 raw streams.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.