-
Notifications
You must be signed in to change notification settings - Fork 388
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
getScaledFrameAtTime returns black bitmap on some videos #265
Comments
In your test application use the following code: |
same problem ,hope to solved it |
Are all of your videos greater or equal to 10000000L in length? If not, then the library is probably returning the last available frame in the video, which may be black, since your timestamp exceeds the content duration. |
The duration of the videos is greater than 10000000L. Some months ago I tried to fix the error, so I downloaded the project, started modifying the native code and if I remember correctly the problem was that FFmpeg couldn't do seek in some situations. |
That makes sense. Thanks for the reply @DeVictorVH. Sorry this library didn't quite meet your needs. |
Bitmap b = fmmr.getFrameAtTime(); This is in the test app but I don't understand why it fixes the problem. |
|
final FFmpegMediaMetadataRetriever retriever = new FFmpegMediaMetadataRetriever();
retriever.setDataSource(source.getPath());
final Bitmap bitmap = retriever.getScaledFrameAtTime(10000000L, width, height);
It returns black bitmap on some videos, but using a different option (FFmpegMediaMetadataRetriever.OPTION_CLOSEST, OPTION_CLOSEST_SYNC, etc) fixes it but others get the same problem;
Tested on a Redmi 9 (android 11) and Bluestacks emulator (android 7)
The text was updated successfully, but these errors were encountered: