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
186 stars 282 forks source link

Get the video thumbnail error #82

Open lan2000 opened 3 years ago

lan2000 commented 3 years ago

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Android Studio (version 2020.3) [✓] Connected device (1 available)

ipad -14.7.1

Get the video thumbnail error: couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x2810c7c00 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

lan2000 commented 3 years ago

The first time to get the picture is successful, the second time it fails.

lan2000 commented 3 years ago

The video is in the cache path of the app

lan2000 commented 3 years ago

Stable versions of video_thumbnail : 0.4.3

justsoft commented 3 years ago

1) Make sure the second video is readable, before call the thumbnail function, try to read the content from the video file. 2) Use the thumbnailData instead of thumbnailFile to see any difference.

lan2000 commented 3 years ago
  1. Make sure the second video is readable, before call the thumbnail function, try to read the content from the video file.
  2. Use the thumbnailData instead of thumbnailFile to see any difference.

It has been confirmed that the video is readable, and the video can be played directly An error is reported when thumbnailFile:

couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283b15260 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}} [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: PlatformException(IO Error, Failed to write data to file, null, null)

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)

1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)

2 VideoThumbnail.thumbnailFile (package:video_thumbnail/video_thumbnail.dart:44:12)

3 _TrimmerViewPageState.build. (package:video_thumbnail_example/trimmer_view_page.dart:194:38)

justsoft commented 3 years ago
  1. Make sure the second video is readable, before call the thumbnail function, try to read the content from the video file.
  2. Use the thumbnailData instead of thumbnailFile to see any difference.

It has been confirmed that the video is readable, and the video can be played directly An error is reported when thumbnailFile:

couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283b15260 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}} [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: PlatformException(IO Error, Failed to write data to file, null, null)

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)

1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)

2 VideoThumbnail.thumbnailFile (package:video_thumbnail/video_thumbnail.dart:44:12)

3 _TrimmerViewPageState.build. (package:video_thumbnail_example/trimmer_view_page.dart:194:38)

So, the thumbnailData works? Only the thumbnailFile failed, right? Check your iOS external storage write permission. Also switch to use the thumbnailData then write the data into file by yourself.

lan2000 commented 3 years ago

Both thumbnailFile and thumbnailData have the same error. I have checked the storage permissions.

------------------ 原始邮件 ------------------ 发件人: "John @.>; 发送时间: 2021年8月18日(星期三) 中午11:06 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [justsoft/video_thumbnail] Get the video thumbnail error (#82)

Make sure the second video is readable, before call the thumbnail function, try to read the content from the video file.

Use the thumbnailData instead of thumbnailFile to see any difference.

It has been confirmed that the video is readable, and the video can be played directly An error is reported when thumbnailFile:

couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283b15260 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}} [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: PlatformException(IO Error, Failed to write data to file, null, null)

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)

1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)

2 VideoThumbnail.thumbnailFile (package:video_thumbnail/video_thumbnail.dart:44:12)

3 _TrimmerViewPageState.build. (package:video_thumbnail_example/trimmer_view_page.dart:194:38)

So, the thumbnailData works? Only the thumbnailFile failed, right? Check your iOS external storage write permission. Also switch to use the thumbnailData then write the data into file by yourself.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

justsoft commented 3 years ago

Try to use ffmpeg to convert to another format of the video or different color space to see any difference?

behlsoft commented 3 years ago

facing same issue.. 1st time it works fine but second time it fails...

sadaqatdev commented 2 years ago

why this issue is close , it still occurring in latest version of package

justsoft commented 2 years ago

Please check out the new 0.5.0 version. Thanks.

haozi5460 commented 2 years ago

facing same issue.. 1st time it works fine but second time it fails...

The same issue 1st time it works fine but second time it fails... V0.5.0

justsoft commented 2 years ago

Please provide me an URL which I can repro this issue. Thanks