HHK1 / PryntTrimmerView

A set of tools to trim, crop and select frames inside a video
MIT License
835 stars 199 forks source link

Could not calculate the thumbnail size. #61

Closed alfredolucomav closed 3 years ago

alfredolucomav commented 4 years ago

Hello There,

I'm trying to load thumbnails from my video into trim view. But I have the following error: Could not calculate the thumbnail size.

This is my video's location: file:///private/var/mobile/Containers/Data/PluginKitPlugin/D7ABED4E-C54A-4948-B7D3-5587AE62358D/tmp/trim.CCA9A520-F11E-4BA6-A3A8-B15AA9E05CAC.MOV

IMG_9415

What could be happening?

Best Regards

alfredolucomav commented 4 years ago

Can anybody help me?

phamhongnham commented 4 years ago

please change video to the m4v format. I have same issue.

alfredolucomav commented 4 years ago

hi @phamhongnham ,

Do u know what's the current format?

Best Regards

jaredmoskowitz commented 4 years ago

I had the same problem. You may be setting your trimmerView.asset before the frame is created for the trimmerView. If you want the thumbnail images to show up on the parent view controller when the parent view controller is presented then call trimmerView.asset = asset in override func viewDidAppear(_ animated: Bool)

Note: I did not have to convert file to m4v format.

alfredolucomav commented 4 years ago

@jaredmoskowitz Thanks a lot! It works like a charm!

mahesh-dhapa commented 4 years ago

I had the same problem. You may be setting your trimmerView.asset before the frame is created for the trimmerView. If you want the thumbnail images to show up on the parent view controller when the parent view controller is presented then call trimmerView.asset = asset in override func viewDidAppear(_ animated: Bool)

Note: I did not have to convert file to m4v format.

I'm facing same issue. First i tried to load video from bundle and created Asset from bundle URL.

`guard let bundlePath = Bundle.main.path(forResource: "Full_Video_Sample", ofType:"mp4"), let url = URL(string: bundlePath) else { print("Can not find Full_Video_Samplem4v") return } currentAsset = AVAsset(url: url)

trimmerView?.asset = currentAsset trimmerView?.delegate = self addVideoPlayer(with: currentAsset!, playerView: playerView) trimmerView` is not nil as i created it dynamically in viewDidLoad.

Shivani-Bajaj commented 3 years ago

I had the same problem. You may be setting your trimmerView.asset before the frame is created for the trimmerView. If you want the thumbnail images to show up on the parent view controller when the parent view controller is presented then call trimmerView.asset = asset in override func viewDidAppear(_ animated: Bool)

Note: I did not have to convert file to m4v format.

Thanks @jaredmoskowitz . It worked 👍