HHK1 / PryntTrimmerView

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

Cropping Video Only Saves 0:00 Video #46

Open SatbirTanda opened 5 years ago

SatbirTanda commented 5 years ago

@HHK1 In the example app: when you crop a video it only saves one frame at a video length of 0:00? Shouldn't it crop all frames in the video and save it?

HHK1 commented 5 years ago

@SatbirTanda did you find what was going on ?

SatbirTanda commented 5 years ago

I wrote a custom method that applies the crop to every frame

HHK1 commented 5 years ago

Hmm, I've checked the example, there is this line:

let frame1Time = CMTime(seconds: 0.2, preferredTimescale: asset.duration.timescale)

The default behaviour should be to crop the whole video, I've probably pushed this while I was testing things. I'll take a look at it, and clean the example app a bit. Thanks for pointing that out !

alanpridestar commented 5 years ago

Hi HHK1,

Was wondering if there have been any updates to this. I haven't been able to create my own method to fix this.

Thanks, Alan

arqambutt commented 3 years ago

Replace this line:

let frame1Time = CMTime(seconds: 0.2, preferredTimescale: asset.duration.timescale)

with this one:

let frame1Time = CMTime(value: asset.duration.value, timescale: asset.duration.timescale)