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

Sometimes unable to create thumbnails #71

Closed nero-angela closed 3 years ago

nero-angela commented 3 years ago

Thanks for making the package.

I am currently using the ^0.2.5+1 version, and I am making a silent camera. I am working on extracting thumbnails from short videos taken with the camera package. 4 out of 5 works fine, but sometimes I get an error saying that the thumbnail cannot be created.

code

await controller.startVideoRecording();
Future.delayed(Duration(milliseconds: 300), () async {
  final videoFile = await controller.stopVideoRecording();
  final image = VideoThumbnail.thumbnailData(video: videoFile.path);
});

device info platform: iOS device model: iPhone8 device version: 14.4.1

screenshot

스크린샷 2021-04-17 오후 3 17 28
justsoft commented 3 years ago

Try something out: 1) Make sure the video is readable before call thumbnailData 2) Retry once thumbnailData failed