HHK1 / PryntTrimmerView

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

Thumbnails are Black #64

Open omarojo opened 4 years ago

omarojo commented 4 years ago

Hi and thank you for building this library. AVFoundation is soo hard.

So I have a VideoComposition that has 5 videos stitched together one after the other. And then played in a AVPlayer, when I export into a .mp4 file all videos get stiched together well (no black frames). In other words... Im not playing a .mp4 file but a AVComposition. Im assigning a AVAsset that is generated from a composition of several mp4 files.

But the problem is when I try to load the playerItem into PryntTimmerView. It loads black frames on every pair index. For example the first clip is fine, but second and fourth clips show black frames as thumbnails. always pairs. If I keep adding clips to the composition, it's always the pair index that will show black frames.

I read that maybe using requestedTimeToleranceAfter may help.

    assetImgGenerate.requestedTimeToleranceAfter = .zero
    assetImgGenerate.requestedTimeToleranceBefore = .zero

Video Attached: https://youtu.be/mYFcBLS1DQE

omarojo commented 4 years ago

I think I figure it out. I had to modify your library to accept having custom ImageGenerator.

Monkey-X-Byte commented 4 years ago

I also found this problem, and even with these two properties, the scrolling thumbnails overlapped

HHK1 commented 4 years ago

Hi @omarojo, do you have a repo with an example ? If you have a fix you can open a PR, contributions are welcome !