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

iOS generate thumbnail returns OS Error: No such file or directory, errno = 2 #107

Closed GiamBoscaro closed 2 years ago

GiamBoscaro commented 2 years ago

Device: iOS simulator Flutter version: 2.10.3 video_thumbnail: 0.5.0

Works on Android, but not iOS. I keep getting an error

The following FileSystemException was thrown resolving an image codec: Cannot open file, path = '/Users//Library/Developer/CoreSimulator/Devices/09E36588-525D-48E6-AB94-1E48476B9B40/data/Containers/Data/Application/F4D0D415-CE67-4B34-A486-AE5393CF6F37/Library/Caches/VID_2022-04-14%2009-56-07.jpg' (OS Error: No such file or directory, errno = 2)

Here's the code

      String? thumbnail = await VideoThumbnail.thumbnailFile(
        video: url,
        thumbnailPath: (await getTemporaryDirectory()).path,
        imageFormat: ImageFormat.JPEG,
        quality: 65,
      );
      return thumbnail;
justsoft commented 2 years ago

Try this to see any difference?

 String? thumbnail = await VideoThumbnail.thumbnailFile(
        video: url,
        thumbnailPath: (await getTemporaryDirectory()).path + '/VID_2022-04-14_09-56-07.jpg',
        imageFormat: ImageFormat.JPEG,
        quality: 65,
      );
      return thumbnail;