Skip to content
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

Can't generate thumbnail #4

Closed
lifenautjoe opened this issue Aug 28, 2019 · 2 comments
Closed

Can't generate thumbnail #4

lifenautjoe opened this issue Aug 28, 2019 · 2 comments

Comments

@lifenautjoe
Copy link

lifenautjoe commented Aug 28, 2019

Calling

VideoThumbnail.thumbnailData(
            video: postVideo.path,
            imageFormat: ImageFormat.JPEG,
            maxHeightOrWidth: 128,
            quality: 25)

Results in

I/flutter (15129): File: '/storage/emulated/0/DCIM/Camera/VID_20190828_120040.mp4'
D/ThumbnailPlugin(15129): buildThumbnailData( format:0, maxhow:128, quality:25 )
D/ThumbnailPlugin(15129): setDataSource: /storage/emulated/0/DCIM/Camera/VID_20190828_120040.mp4 )
W/System.err(15129): java.lang.IllegalArgumentException
W/System.err(15129): 	at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:76)
W/System.err(15129): 	at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.createVideoThumbnail(VideoThumbnailPlugin.java:154)
W/System.err(15129): 	at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.buildThumbnailData(VideoThumbnailPlugin.java:95)
W/System.err(15129): 	at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.onMethodCall(VideoThumbnailPlugin.java:59)
W/System.err(15129): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
W/System.err(15129): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
W/System.err(15129): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
W/System.err(15129): 	at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(15129): 	at android.os.MessageQueue.next(MessageQueue.java:326)
W/System.err(15129): 	at android.os.Looper.loop(Looper.java:160)
W/System.err(15129): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
W/System.err(15129): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(15129): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W/System.err(15129): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
W/System.err(15129): java.lang.NullPointerException
W/System.err(15129): 	at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.buildThumbnailData(VideoThumbnailPlugin.java:97)
W/System.err(15129): 	at xyz.justsoft.video_thumbnail.VideoThumbnailPlugin.onMethodCall(VideoThumbnailPlugin.java:59)
W/System.err(15129): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
W/System.err(15129): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
W/System.err(15129): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
W/System.err(15129): 	at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(15129): 	at android.os.MessageQueue.next(MessageQueue.java:326)
W/System.err(15129): 	at android.os.Looper.loop(Looper.java:160)
W/System.err(15129): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
W/System.err(15129): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(15129): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W/System.err(15129): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
@justsoft
Copy link
Owner

Thanks for providing this error report. Looks like the video can't be decoded on the device or it doesn't have sufficient frames to be decoded.
Please try to install appropriate decoder or test a longer video to see the error goes away.

@lifenautjoe
Copy link
Author

The error was on my side. The media picker was passing a file with a closed descriptor. Library works great on actual files. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants