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

Cropping Video Only Saves 0:00 Video #46

Open
SatbirTanda opened this issue Apr 8, 2019 · 5 comments
Open

Cropping Video Only Saves 0:00 Video #46

SatbirTanda opened this issue Apr 8, 2019 · 5 comments

Comments

@SatbirTanda
Copy link

SatbirTanda commented Apr 8, 2019

@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
Copy link
Owner

HHK1 commented Apr 12, 2019

@SatbirTanda did you find what was going on ?

@SatbirTanda
Copy link
Author

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

@HHK1
Copy link
Owner

HHK1 commented Apr 12, 2019

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 HHK1 reopened this Apr 12, 2019
@alanpridestar
Copy link

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
Copy link

arqambutt commented Aug 16, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants