PryntTrimmerView icon indicating copy to clipboard operation
PryntTrimmerView copied to clipboard

Cropping Video Only Saves 0:00 Video

Open SatbirTanda opened this issue 5 years ago • 5 comments

@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?

SatbirTanda avatar Apr 08 '19 09:04 SatbirTanda

@SatbirTanda did you find what was going on ?

HHK1 avatar Apr 12 '19 11:04 HHK1

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

SatbirTanda avatar Apr 12 '19 11:04 SatbirTanda

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 !

HHK1 avatar Apr 12 '19 11:04 HHK1

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

alanpridestar avatar Sep 18 '19 13:09 alanpridestar

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)

arqambutt avatar Aug 16 '21 18:08 arqambutt