Skip to content
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

Does OpenCV really support FFmpeg 5.0+ on Windows? #25750

Open
4 tasks done
Chenwei-Ni opened this issue Jun 12, 2024 · 1 comment
Open
4 tasks done

Does OpenCV really support FFmpeg 5.0+ on Windows? #25750

Chenwei-Ni opened this issue Jun 12, 2024 · 1 comment

Comments

@Chenwei-Ni
Copy link

System Information

// C# user
OpenCV version: 4.5.5
Operating System: Windows 10 Enterprise

Detailed description

My application uses VideoCapture to open a http video stream for images. And for robustness, I need to test the case when the http video stream is not available sometimes. While testing this case, I found that my program crashed. It is not a stably reproducible bug.

image
image

After debugging and investigation, I found that this issue was introduced in FFmpeg 4.3 and fixed in FFmpeg 5.0.

So, I tried to downgrade the OpenCV version to 4.4.0 which is with FFmpeg 4.2.3 and it works well. It will log invalid stream index but won't crash.

However, according to the change log of OpenCV, OpenCV supports FFmpeg 5.0+ since version 4.6.0. But that's not what I tested. It seemed that even OpenCV 4.9.0 is still with FFmpeg 4.4.

I don’t know exactly how OpenCV integrates with FFmpeg. I cannot tell which version of FFmpeg is integrated from below file:
opencv/3rdparty/ffmpeg/ffmpeg.cmake at 4.9.0 · opencv/opencv (github.com)

I just wonder does OpenCV really support FFmpeg 5.0+? If not, which version will it be supported in the future?

Steps to reproduce

My code like this:

var videoCapture = new VideoCapture();
while (!videoCapture.IsOpened()) videoCapture.Open(url);
receivingImgTask.Start();

Reproduce Step:
Disconnect the network cable to make the http video stream unavailable and reconnect.
Do above step several times and the application will crash.
It is hard to reproduce sometimes. maybe reproduced 5 times out of 50 reconnections.

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@Chenwei-Ni Chenwei-Ni added the bug label Jun 12, 2024
@asmorkalov asmorkalov changed the title Does OpenCV really support FFmpeg 5.0+? Does OpenCV really support FFmpeg 5.0+ on Windows? Jun 14, 2024
@Siddharth-Latthe-07
Copy link

I guess, the problem lies in the version of the OS wherein the latest binaries are being installed, I read an article regarding the above, wherein the version of the OS, might play a role for Precompiled binaries of libraries (like the FFmpeg DLLs mentioned) are often built for specific OS versions or distributions. These binaries may rely on particular versions of system libraries that differ between OS versions. The opencv library do support ffmpeg 5.0
https://ffmpeg.org/documentation.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants