justsoft / video_thumbnail

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.
MIT License
183 stars 238 forks source link

MissingPluginException and null pointer #106

Open LeGoffMael opened 2 years ago

LeGoffMael commented 2 years ago

When requesting a specific timsMs, i am consistently facing a MissingPluginException and null pointer exception.

E[/MediaMetadataRetrieverJNI]()(14809): getFrameAtTime: videoFrame is a NULL pointer

When i am using this video (https://drive.google.com/file/d/1rcQb3E14Kmv-5qtJqxax3xSB9WzsY3Q5/view?usp=sharing ) at 8357 ms time.

✅ The error occurs on a Galaxy S7 Edge running Android 8 ❌ The error does not occurs on a Galaxy S8 running Android 9

justsoft commented 2 years ago

Hi LeGoffMael,

Is it still an issue regarding the following error? Thanks

When requesting a specific timsMs, i am consistently facing a MissingPluginException and null pointer exception.

E[/MediaMetadataRetrieverJNI]()(14809): getFrameAtTime: videoFrame is a NULL pointer
ertan2002 commented 2 years ago

I get the same error with a direct firebase url like https://firebasestorage.googleapis.com/v0/b/myprojec-68aa.appspot.com/o/XXX%2FXXXX?alt=media&token=1d51-ccadade-4drd-8ade2-bdf4afa7f1ba89

and as you see there is already %2F but anyway I got the following exception

Error: MissingPluginException(No implementation found for method data on channel plugins.justsoft.xyz/video_thumbnail) at Object.throw_ [as throw] (http://localhost:50532/dart_sdk.js:5067:11) at MethodChannel._invokeMethod (http://localhost:50532/packages/flutter/src/services/restoration.dart.lib.js:1560:21) at _invokeMethod.next (<anonymous>) at http://localhost:50532/dart_sdk.js:40571:33 at _RootZone.runUnary (http://localhost:50532/dart_sdk.js:40441:59) at _FutureListener.thenAwait.handleValue (http://localhost:50532/dart_sdk.js:35363:29) at handleValueCallback (http://localhost:50532/dart_sdk.js:35931:49) at Function._propagateToListeners (http://localhost:50532/dart_sdk.js:35969:17) at _Future.new.[_completeWithValue] (http://localhost:50532/dart_sdk.js:35817:23) at async._AsyncCallbackEntry.new.callback (http://localhost:50532/dart_sdk.js:35838:35) at Object._microtaskLoop (http://localhost:50532/dart_sdk.js:40708:13) at _startMicrotaskLoop (http://localhost:50532/dart_sdk.js:40714:13) at http://localhost:50532/dart_sdk.js:36191:9

and I call like this

var arr = await VideoThumbnail.thumbnailData( video: url, imageFormat: ImageFormat.JPEG, // maxWidth: 128, quality: 80, );

The reason I call thumbnailData method is that I am doing for the web. So I upload videos to the firebase cloud and get the link and create thumbnail by this link. I know that I cannot give the path to save the thumbnail, that's why I try to do with uint8list. I dont know if it is the reason or something else.

Otherwise, I have to create my own webservice to this job.

Waiting for a quick help...

PS: using version 0.5.0

LeGoffMael commented 2 years ago

Hi LeGoffMael,

Is it still an issue regarding the following error? Thanks

When requesting a specific timsMs, i am consistently facing a MissingPluginException and null pointer exception.

E[/MediaMetadataRetrieverJNI]()(14809): getFrameAtTime: videoFrame is a NULL pointer

I confirm that i am still facing this issue, it is quite tricky to get it because it depends of the ms time frame and of the video and of the device. I only faced this issue on Android for the moment.

justsoft commented 2 years ago

@LeGoffMael @ertan2002 Have you tried this fix? https://github.com/justsoft/video_thumbnail/issues/94#issuecomment-1120537449

ertan2002 commented 2 years ago

@LeGoffMael @ertan2002 Have you tried this fix? #94 (comment)

I do not have problem ios or taking photo ... It happens when I use a firebase link (direct url). anyway I wrote my webservice and now it does the job. But if you have a fix, let me know.

You can reprocedure the error. Upload a video to firebase and copy the URL and let see what happens.

LeGoffMael commented 2 years ago

@LeGoffMael @ertan2002 Have you tried this fix? #94 (comment)

Same for me, the error only occurs on android

WeebNetsu commented 2 years ago

This is also an issue on Xiaomi Redmi 9T (Android 11), but not Google Pixel 5 (Android 11 - emulator)

JoergPf commented 1 year ago

Same here on Android Pixel2.

When I try to get a still at a timeMs I get the error getFrameAtTime: videoFrame is a NULL pointer

Is there a fix?

EricPHPH commented 1 year ago

Same issue here, it occurs on some videos, but not on others.

thao-vu-0106 commented 1 year ago

in my case, i have an error file mp4 so this lib can't get thumbnail image. But instead of move next to another video, it throw exception and break the loop. So i just add try catch when i get thumbnail, and it works