video_thumbnail icon indicating copy to clipboard operation
video_thumbnail copied to clipboard

VideoFrame is a NULL pointer

Open indeedshaw opened this issue 2 years ago • 2 comments

At first, I ignored the problem, thinking it was the video. However, as the number of videos increased, more and more videos appeared this problem, but this problem is less common in Android native demo. Android natve demo, the same impl as plugin: S31009-16454095_com example mykotlinapplication-cut

It's a weird question. I rewrote a plugin with the same implementation and got the same result as the video_thumbnail plugin. When I changed two places, the results became better: image

Although some videos still get this error, the result is still better than the beginning, in my case, it is good enough~

Of course, if you do not care that the screenshot is anywhere in the video, you can use this: mediaMetadataRetriever.frameAtTime For other useages, refer to the api in the MediaMetadataRetriever.

hopefully the plugin will be maintained! @justsoft

indeedshaw avatar Oct 09 '23 09:10 indeedshaw

I encountered the same problem.

E/AndroidRuntime(29443): FATAL EXCEPTION: FinalizerWatchdogDaemon E/AndroidRuntime(29443): Process:  
 com.example.camera, PID: 29443 E/AndroidRuntime(29443): java.util.concurrent.TimeoutException:  
 android.media.MediaMetadataRetriever.finalize() timed out after 10 seconds E/AndroidRuntime(29443): at  
  android.media.MediaMetadataRetriever.native_finalize(Native Method) E/AndroidRuntime(29443): at  
 android.media.MediaMetadataRetriever.finalize(MediaMetadataRetriever.java:332) E/AndroidRuntime(29443): at  
  java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:222) E/AndroidRuntime(29443): at  
  java.lang.Daemons$FinalizerDaemon.run(Daemons.java:209) E/AndroidRuntime(29443): at  
  java.lang.Thread.run(Thread.java:761) E/libEGL (29443): call to OpenGL ES API with no current context (logged once per  
 thread) E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer   
 E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer    
  E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer    
 E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer  
 E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer  
 E/MediaMetadataRetrieverJNI(29443): getFrameAtTime: videoFrame is a NULL pointer  

nuxwork avatar Oct 16 '23 09:10 nuxwork

Any Update on This Issue got the same Exception on flutter app and the App got crashed.

FATAL EXCEPTION: FinalizerWatchdogDaemon
E/AndroidRuntime(30927): Process: com.metasense.lqdcnvs_mobile, PID: 30927
E/AndroidRuntime(30927): java.util.concurrent.TimeoutException: android.media.MediaMetadataRetriever.finalize() timed out after 10 seconds
E/AndroidRuntime(30927): 	at android.media.MediaMetadataRetriever.native_finalize(Native Method)
E/AndroidRuntime(30927): 	at android.media.MediaMetadataRetriever.finalize(MediaMetadataRetriever.java:1127)
E/AndroidRuntime(30927): 	at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:339)
E/AndroidRuntime(30927): 	at java.lang.Daemons$FinalizerDaemon.processReference(Daemons.java:324)
E/AndroidRuntime(30927): 	at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:300)
E/AndroidRuntime(30927): 	at java.lang.Daemons$Daemon.run(Daemons.java:145)
E/AndroidRuntime(30927): 	at java.lang.Thread.run(Thread.java:1012)
I/Process (30927): Sending signal. PID: 30927 SIG: 9
Lost connection to device.

Munsif-Ali avatar Apr 25 '24 11:04 Munsif-Ali