-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Always get java.lang.IllegalStateException: mediaMetadataRetriever.e…ETADATA_KEY_VIDEO_HEIGHT) must not be null #16
Comments
Thank you for raising this issue. Could you please try to save your source video with the values added and try the sample app of the library? Let me know if you face the same issue. Thank you |
I also experiencing similar issue with other video compressor library. I think it is because the DURATION metadata sometimes return NULL which causes crash while the compressor trying to parse it into Long. I tried to catch the exception from my code to prevent crash but not success. I have also tried to import the library as a module to modify compressor code to set the process as failed if one of the required data is null (to prevent crash), but since I'm using Java there is some error associated with compilation and I don't know where the cause is because the compiler didn't tell me where.
What do you think? |
It's a bit difficult to identify the issue. But there are a few things you can try to narrow down the causes. For example, will it work if you don't set a hight and width? Are you sure the values you pass are not Null? How can the duration be null? You can start with hardcoded values, and see if the problem is with the library handling the values, or the problem in the original values passed to the library. Looking forward to hearing from you |
Are you sure the values you pass are not Null? Yes, because the duration is computed while recording the video. If the video itself present and can be played, how can the duration be null? I'm pretty sure that the duration is not null, because the video is there, it can be played, and there is a duration information on the video file. But this problem is not on every device, currently it's on Xiaomi where it's keep getting crashed. Is it possible to send custom height, width or duration to the library? The
|
It's fine if the library couldn't continue to process the compression because the needed information is incomplete. I could just tell the user to use the file as is or re-record a new video. But, I would like to prevent it from crashing the app. |
Thank you for your feedback. I can add this option to pass video height, width, and duration if needed. But what would be the purpose of doing that? Since the library would extract that while keeping the ratio of the video so It does not get stretched for instance. |
I don't think you need to add option to pass the values, I mean this problem only happen on some phone (in my Samsung I never experience this). But, how about sending a failed flag if the required data is null before converting the null value to int or long? |
Yes sure, I will handle this and will notify you when it's done. Thank you a lot :D |
Please try version 0.6.2 and close the issue if everything is ok |
Tested and never crashed on the devices which got it before. |
I use light compressor to compress video right after completing it's recording.
Before starting light compressor, I export the video with this code:
I have added MediaStore.Video.MEDIA.HEIGHT value, but why the exception state that it's null? Is it because the different value?
The text was updated successfully, but these errors were encountered: