-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
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
[Android] When VideoCapture.read is executed, if the stride is longer than the width of the video, an error will occur. #25886
Comments
@Dev-Czle How do you get the video? Could you reproduce the issue with video-recorder sample? The same makes recording with VideoWriter and then plays back it with VideoCapture. Could you attach small video to reproduce the issue? |
@asmorkalov The video's information is as follows: Width: 1024 Additionally, I conducted tests with various versions. Previous version: 4.5.5Target version: 4.9.0Tested versions:
The error logs consistently showed that the stride was longer than the width. I hope this information is helpful to you. |
Relates to changes in #22227 |
@Dev-Czle I found couple of suspicious places and tries to reproduce the issue locally. Could you attach complete logcal log for the crash case? |
@asmorkalov
Even though I synchronized and used a single thread suspecting it might be a thread collision issue, the errors still occur. |
@asmorkalov excuse me, did u check crash logs? |
Not yet, sorry. Will try to handle it in mean time. |
@Dev-Czle I've created a small app, that plays your video, and it works fine. Could you please test it on your device? The project should work in Android Studio without any changes. |
Just tried with Xiaomi mi 10 and Samsung Galaxy S10. The attached code works fine with both devices. |
@alexlyulkov thanks. i will check it by my devices and tell you soon :) Not all devices experienced crashes with my videos. The issue occurred on specific devices, such as the Galaxy ZFlip3 or Google Pixel 7. I also confirmed that the issue happened on the Galaxy S24. However, the issue occurred with videos other than the one I sent you. I am quite disappointed about this as well. |
System Information
OpenCV Version : 4.9.0
Operating System / Platform: Android 14 / Samsung Galaxy Flip3 and Google Pixel 7
Compiler & compiler version: Android Studio
Detailed description
in Android version 14, i use
Previously, we were using OpenCV 4.5.5. After updating the Android version to 14 and OpenCV to 4.9.0, we discovered crashes occurring on some devices with certain videos. The logs for these videos revealed a common issue: the stride reported in the NativeCodec log was longer than the width.
Perhaps it is related to "#22214"
I think the value of the stride is not being initialized when it changes.
when
called, can see "format changed" log too
However, it seems that even though the stride value changes when "updating image-data" is called again, this updated value is not being properly reflected in the stride. so i can see this log
even stride is updated 1280
It has been confirmed that this issue also occurs in the latest version, 4.10.0.
Steps to reproduce
It seems that the error occurs at the "videoCapture.read(mat)"
Issue submission checklist
The text was updated successfully, but these errors were encountered: