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

download video couldn't generate thumbnail #105

Closed
yoonjiyong opened this issue Apr 26, 2021 · 25 comments
Closed

download video couldn't generate thumbnail #105

yoonjiyong opened this issue Apr 26, 2021 · 25 comments
Labels
bug Something isn't working as expected investigating Looking into the issue for a probable fix

Comments

@yoonjiyong
Copy link

yoonjiyong commented Apr 26, 2021

hi

when I pick download video.
below error occurs on iOS ( iPhone7 )
android works fine

flutter: /private/var/mobile/Containers/Data/Application/09F51573-CA6E-49BA-A792-E7FEBF4A5F74/tmp/_talkv_woYgOXv7ml_zSU8dBVSYS00f6uxummnuk_talkv_high.mp4 couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283f9c690 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

Image

https://helloworld43943.tumblr.com/image/649523710269767680

thx for your effort 😇

@Vitaly-V
Copy link

I have the same error. But it seems to be video-dependent.
E.g. this video works fine https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4

@amarchenko25
Copy link

Hi All,
have the same issue on iOS. Seems like an issue with video_thumbnail plugin. It cannot produce the last duration time thumbnail.
Do you have any progress?

@char-lance-flamme
Copy link

Hello,
Have the same issue on IOS. Please assist, really need to fix it. :(
couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x283f9c690 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

@sbis04
Copy link
Owner

sbis04 commented May 21, 2021

@yoonjiyong @char-lance-flamme @amag2511 Have you added the proper permissions to the Info.plist file as stated here

Also, let me know which iOS version are you using.

@Vitaly-V
Copy link

Hi All,

@amag2511
I don't have any progress with it.

@sbis04
ios/Runner/Info.plist

<key>NSCameraUsageDescription</key> <string>Used to get user profile image</string> <key>NSMicrophoneUsageDescription</key> <string>Used to capture audio for video upload</string> <key>NSPhotoLibraryUsageDescription</key> <string>Used to get user profile image</string>

Device - iPhone 8
Softvare version - 14.4.2

As I mentioned above - with some videos it works cool, but with others, it returns the error.

@sbis04
Copy link
Owner

sbis04 commented May 21, 2021

@Vitaly-V can you provide some videos using which you are facing this issue? I will try to reproduce the error and then look into it.

@char-lance-flamme
Copy link

char-lance-flamme commented May 21, 2021

@sbis04
It is my Info.plist
NSCameraUsageDescription
Used to demonstrate image picker plugin
NSMicrophoneUsageDescription
Used to capture audio for image picker plugin
NSPhotoLibraryUsageDescription
Used to demonstrate image picker plugin

my Device Iphone XR
IOS 14.4.2(18D70)

@sbis04 sbis04 added the bug Something isn't working as expected label May 21, 2021
@Vitaly-V
Copy link

Vitaly-V commented Jun 7, 2021

Guys, any updates?

@Gicminos
Copy link

I also experience the same problem. Here are more details in case they can help:

image

Here is the error in console:

Flutter: Attempted to composite external texture sources using the software backend. This backend is only used on simulators. This feature is only available on actual devices where OpenGL or Metal is used for rendering.
Flutter: Attempted to composite external texture sources using the software backend. This backend is only used on simulators. This feature is only available on actual devices where OpenGL or Metal is used for rendering.
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following _CastError was thrown building:
flutter: Null check operator used on a null value
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      ThumbnailViewer.build.<anonymous closure>.<anonymous closure> (package:video_trimmer/src/thumbnail_viewer.dart:63:58)
flutter: #1      SliverChildBuilderDelegate.build (package:flutter/src/widgets/sliver.dart:455:22)
flutter: #2      SliverMultiBoxAdaptorElement._build (package:flutter/src/widgets/sliver.dart:1213:28)
flutter: #3      SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:1226:55)
flutter: #4      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2535:19)
flutter: #5      SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1219:12)
flutter: #6      RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:349:23)
flutter: #7      RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1889:59)
flutter: #8      PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:912:15)
flutter: #9      RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1889:14)
flutter: #10     RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:338:5)
flutter: #11     RenderSliverMultiBoxAdaptor.insertAndLayoutChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:484:5)
flutter: #12     RenderSliverList.performLayout.advance (package:flutter/src/rendering/sliver_list.dart:239:19)
flutter: #13     RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:282:19)
flutter: #14     RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
flutter: #15     RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:137:12)
flutter: #16     RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:371:11)
flutter: #17     RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
flutter: #18     RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:510:13)
flutter: #19     RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1574:12)
flutter: #20     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1483:20)
flutter: #21     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1636:7)
flutter: #22     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:881:18)
flutter: #23     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:462:19)
flutter: #24     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:876:13)
flutter: #25     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328:5)
flutter: #26     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
flutter: #27     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9)
flutter: #28     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998:5)
flutter: #32     _invoke (dart:ui/hooks.dart:163:10)
flutter: #33     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259:5)
flutter: #34     _drawFrame (dart:ui/hooks.dart:126:31)
flutter: (elided 3 frames from dart:async)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════

flutter doctor (iOS only):

[✓] Flutter (Channel stable, 2.2.1, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Connected device (2 available)

Thanks. Happy to provide more details if it helps.

@sbis04
Copy link
Owner

sbis04 commented Jun 17, 2021

@Gicminos I see that the above screenshot is from an iOS Simulator, so did you try it on a physical device? Also, did you try with any different video to check if the error persists in that as well?

@Vitaly-V
Copy link

@sbis04, on the real devices' error looks pretty the same.
Yes, it's video dependent, - some videos are trimming well, some with this error.

@sbis04
Copy link
Owner

sbis04 commented Jun 18, 2021

@Vitaly-V Can you please share a video file or it's link which is producing this error?

@Vitaly-V
Copy link

Vitaly-V commented Jun 18, 2021

@Gicminos
Copy link

I confirm what Vitaly-V is saying. The error on the real device is the same (while on release mode you see the gray band instead of the red error) and it is yes video dependant.

@Gicminos
Copy link

This PR #112 seems to be claiming to fix this error. Happy to test it myself in the next days, but will probably have to fork it and test it with just a cherry-pick of 82898fa because I am not sure about the other changes.

This was referenced Jul 1, 2021
@sbis04
Copy link
Owner

sbis04 commented Jul 1, 2021

Try using the latest version of the plugin:

video_trimmer: ^0.5.2

Let me know if the thumbnail error is fixed.

@Gicminos
Copy link

Gicminos commented Jul 5, 2021

We haven't tested widely yet, but we do indeed see improvements. I will let you know in case of any issues. Thanks!

@sbis04
Copy link
Owner

sbis04 commented Jul 23, 2021

Closing this issue. Feel free to open, if the issue still persists.

@sbis04 sbis04 closed this as completed Jul 23, 2021
@nisargdoshi
Copy link

I am getting this error

Runner[3759:312601] couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x281948270 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

@BanidAzin
Copy link

I am getting this error

Runner[3759:312601] couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11832 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media cannot be used., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x281948270 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

I have the same error

@sbis04
Copy link
Owner

sbis04 commented Dec 9, 2021

@BanidAzin @nisargdoshi is the error occurring with all the videos? On which platform are you testing (Android/iOS)?

@BanidAzin
Copy link

@BanidAzin @nisargdoshi is the error occurring with all the videos? On which platform are you testing (Android/iOS)?

@sbis04 Yes, it's happening for me all the time. I am trying to create a thumbnail after capturing a video using the camera.
I am testing it on iOS.

@sbis04 sbis04 added the investigating Looking into the issue for a probable fix label Dec 10, 2021
@ovib
Copy link

ovib commented Jul 20, 2022

Any progress on this issue? I have the same error on iPhone SE second gen with iOS 15.1

@charlieforward9
Copy link

I am also getting this issue. It does not prevent me from trimming the video, but it does result in a not-so-ideal UX. Looking forward to updates on this. I am testing on a real device iOS (15)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected investigating Looking into the issue for a probable fix
Projects
None yet
Development

No branches or pull requests

10 participants