¡@

Home 

2014/10/15 ¤U¤È 10:15:47

iphone Programming Glossary: videotrack

how to export video asset via AVAssetExportSession in portrait mode

http://stackoverflow.com/questions/10034337/how-to-export-video-asset-via-avassetexportsession-in-portrait-mode

video track of the exported session. Create 2 mutable tracks in your AVComposition object AVMutableCompositionTrack videoTrack composition addMutableTrackWithMediaType AVMediaTypeVideo preferredTrackID kCMPersistentTrackID_Invalid AVMutableCompositionTrack.. preferredTrackID kCMPersistentTrackID_Invalid Add your medias tracks to your composition's tracks ... BOOL videoResult videoTrack insertTimeRange sourceCMTime ofTrack tracks objectAtIndex 0 atTime currentTime error error BOOL audioResult audioTrack.. M_PI_2 CGAffineTransform rotateTranslate CGAffineTransformTranslate rotationTransform 360 0 videoTrack.preferredTransform rotationTransform be carful that the transform had the upper left corner as origin so the translation..

How can I add overlay text on a video, then re-encode it?

http://stackoverflow.com/questions/10190333/how-can-i-add-overlay-text-on-a-video-then-re-encode-it

videoCompositionInstruction instruction.timeRange CMTimeRangeMake kCMTimeZero mixComposition duration AVAssetTrack videoTrack mixComposition tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVMutableVideoCompositionLayerInstruction layerInstruction.. layerInstruction AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack videoTrack instruction.layerInstructions NSArray arrayWithObject layerInstruction videoComp.instructions NSArray arrayWithObject instruction..

Updating UI while reading a video file

http://stackoverflow.com/questions/15493405/updating-ui-while-reading-a-video-file

NSArray arrayWithObject @ tracks completionHandler ^ dispatch_async dispatch_get_main_queue ^ AVAssetTrack videoTrack nil NSArray tracks asset tracksWithMediaType AVMediaTypeVideo if tracks count 1 some code here movieReader startReading..

Programatically access orientation of an iPhone video

http://stackoverflow.com/questions/2814626/programatically-access-orientation-of-an-iphone-video

can use the new AVFoundation libraries. Something like NSURL url url to the video returned by the picker AVAssetTrack videoTrack url tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 videoTrack.preferredTransform CGAffineTransform that tells you.. to the video returned by the picker AVAssetTrack videoTrack url tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 videoTrack.preferredTransform CGAffineTransform that tells you whether the video is rotated from original orientation videoTrack.naturalSize..

how to detect (iphone sdk) if a video file was recorded in portrait orientation, or landscape

http://stackoverflow.com/questions/4627940/how-to-detect-iphone-sdk-if-a-video-file-was-recorded-in-portrait-orientation

developer is now able to rotate a variety of vids so they all match and composite them into one video. AVAssetTrack videoTrack avAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 CGSize size videoTrack naturalSize NSLog @ size.width f size.height.. them into one video. AVAssetTrack videoTrack avAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 CGSize size videoTrack naturalSize NSLog @ size.width f size.height f size.width size.height CGAffineTransform txf videoTrack preferredTransform.. 0 CGSize size videoTrack naturalSize NSLog @ size.width f size.height f size.width size.height CGAffineTransform txf videoTrack preferredTransform NSLog @ txf.a f txf.b f txf.c f txf.d f txf.tx f txf.ty f txf.a txf.b txf.c txf.d txf.tx txf.ty Logs..

How to combine video clips with different orientation using AVFoundation

http://stackoverflow.com/questions/6575128/how-to-combine-video-clips-with-different-orientation-using-avfoundation

alloc initFileURLWithPath path AVURLAsset asset AVURLAsset URLAssetWithURL url options nil url release AVAssetTrack videoTrack asset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVAssetTrack audioTrack asset tracksWithMediaType AVMediaTypeAudio.. AVMediaTypeAudio objectAtIndex 0 set the orientation if i 0 compositionVideoTrack setPreferredTransform videoTrack.preferredTransform ok compositionVideoTrack insertTimeRange CMTimeRangeMake kCMTimeZero asset duration ofTrack videoTrack.. ok compositionVideoTrack insertTimeRange CMTimeRangeMake kCMTimeZero asset duration ofTrack videoTrack atTime startTime error nil ok compositionAudioTrack insertTimeRange CMTimeRangeMake kCMTimeZero asset duration ofTrack audioTrack..

Video Encoding using AVAssetWriter - CRASHES

http://stackoverflow.com/questions/8191840/video-encoding-using-avassetwriter-crashes

NSError aerror nil AVAssetReader reader AVAssetReader alloc initWithAsset avAsset error aerror AVAssetTrack videoTrack avAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 videoWriterInput.transform videoTrack.preferredTransform NSDictionary.. aerror AVAssetTrack videoTrack avAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 videoWriterInput.transform videoTrack.preferredTransform NSDictionary videoOptions NSDictionary dictionaryWithObject NSNumber numberWithInt kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange.. AVAssetReaderTrackOutput asset_reader_output AVAssetReaderTrackOutput alloc initWithTrack videoTrack outputSettings videoOptions reader addOutput asset_reader_output audio setup AVAssetWriterInput audioWriterInput AVAssetWriterInput..

Is it possible to get maximal GPS precision on mobile browser?

http://stackoverflow.com/questions/8257160/is-it-possible-to-get-maximal-gps-precision-on-mobile-browser