Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone 5S slow motion is gone when exporting a video

I want to let the user of my app pick a video from his camera roll and play it,
So I created my own custom picker (need custom UI) to choose the video and when the user pick a video I use AVAssetExportSession to export the video's asset to mp4 file.

If you didn't knew the new iPhone 5S has an option to apply slow motion on a video. However when I export a video with slow motion, the slow motion is gone.

I suspect there is some extra data on the video asset that represent the slow motion part and store information of witch part of the video should be play in lower FPS.

I had a similar issue before with photos, for example if you edit a photo with one of the native iOS filters or crop, and than load the photo using AVAsset to an image view, you will see the original photo (without the filters or crop). Only after examining the ALAssetRepresentation metadata "AdjustmentXMP" key, and applying CIFilter's accordingly, you will get the edited image.

Any ideas?

like image 820
Eyal Avatar asked Nov 19 '13 16:11

Eyal


1 Answers

The video is not 'recorded in slow-mo' it's recorded in 60 frames per second, and then there is an option to play back in 30 frames per second, creating the effect of slow motion. Try setting the frame-rate on your playback after accessing the asset to 30.

like image 97
Uptown Apps Avatar answered Nov 15 '22 21:11

Uptown Apps