Getting video snapshot for thumbnail

后端 未结 1 1554
太阳男子
太阳男子 2020-12-04 13:13

I am recording a video from the iPhone camera by using the AVCam code provided from apple.

After the video is recorded it is saved to the photos library.

A

相关标签:
1条回答
  • 2020-12-04 13:24

    To fix the thumbnail orientation set appliesPreferredTrackTransform to YES in the AVAssetImageGenerator instance. If you add your own video composition, you'll need to include the right transform to rotate the video as wanted.

    generate.appliesPreferredTrackTransform = YES;
    

    Remember to release the obtained image reference with CGImageRelease.

    To request multiple thumbnails it's better to do asynchronously with generateCGImagesAsynchronouslyForTimes:completionHandler:.

    0 讨论(0)
提交回复
热议问题