¡@

Home 

2014/10/15 ¤U¤È 10:04:22

iphone Programming Glossary: avassetimagegenerator

Getting thumbnail from a video url or data in IPhone SDK

http://stackoverflow.com/questions/1347562/getting-thumbnail-from-a-video-url-or-data-in-iphone-sdk

in the example its at time 0 void generateImage AVURLAsset asset AVURLAsset alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime.. void generateImage AVURLAsset asset AVURLAsset alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds.. asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult result NSError..

AVAssetImageGenerator provides images rotated

http://stackoverflow.com/questions/5347800/avassetimagegenerator-provides-images-rotated

provides images rotated When obtaining a UIImage of a video via AVAssetImageGenerator I'm getting back images rotated well.. provides images rotated When obtaining a UIImage of a video via AVAssetImageGenerator I'm getting back images rotated well technically they're not when the video is shot in portrait orientation. How can I tell.. the video was shot and then rotate the image properly AVURLAsset asset AVURLAsset alloc initWithURL url options nil AVAssetImageGenerator generate AVAssetImageGenerator alloc initWithAsset asset NSError err NULL CMTime time CMTimeMake 0 60 CGImageRef imgRef..

Get the screenshot of a streaming video on iphone

http://stackoverflow.com/questions/5388226/get-the-screenshot-of-a-streaming-video-on-iphone

sure if it will work but have you tried using AVPlayer It should give you access to AVURLAsset which you could pass to AVAssetImageGenerator. AVPlayerItem item AVPlayerItem playerItemWithURL yourURL AVPlayer player AVPlayer playerWithPlayerItem pItem observe 'status'.. item AVPlayerItem object if item.status AVPlayerItemStatusReadyToPlay AVURLAsset asset AVURLAsset item.asset AVAssetImageGenerator imageGenerator AVAssetImageGenerator alloc initWithAsset asset CGImageRef thumb imageGenerator copyCGImageAtTime CMTimeMakeWithSeconds.. item.status AVPlayerItemStatusReadyToPlay AVURLAsset asset AVURLAsset item.asset AVAssetImageGenerator imageGenerator AVAssetImageGenerator alloc initWithAsset asset CGImageRef thumb imageGenerator copyCGImageAtTime CMTimeMakeWithSeconds 10.0 1.0 actualTime..