¡@

Home 

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

iphone Programming Glossary: trackswithmediatype

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

AVMediaTypeVideo preferredTrackID kCMPersistentTrackID_Invalid AVAssetTrack clipVideoTrack videoAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 compositionVideoTrack insertTimeRange CMTimeRangeMake kCMTimeZero videoAsset.duration ofTrack.. ofTrack clipVideoTrack atTime kCMTimeZero error nil compositionVideoTrack setPreferredTransform videoAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 preferredTransform CGSize videoSize clipVideoTrack naturalSize UIImage myImage UIImage.. instruction.timeRange CMTimeRangeMake kCMTimeZero mixComposition duration AVAssetTrack videoTrack mixComposition tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVMutableVideoCompositionLayerInstruction layerInstruction AVMutableVideoCompositionLayerInstruction..

How can I overlap audio files and combine for iPhone in Xcode?

http://stackoverflow.com/questions/12628554/how-can-i-overlap-audio-files-and-combine-for-iphone-in-xcode

AVMediaTypeAudio preferredTrackID kCMPersistentTrackID_Invalid AVAssetTrack sourceAudioTrack songAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 NSError error nil BOOL ok NO CMTime startTime CMTimeMakeWithSeconds 0 1 CMTime trackDuration..

Adjusting the volume of a playing AVPlayer

http://stackoverflow.com/questions/3268949/adjusting-the-volume-of-a-playing-avplayer

and the volume you want to set is called volume the following code should do what you want NSArray audioTracks asset tracksWithMediaType AVMediaTypeAudio NSMutableArray allAudioParams NSMutableArray array for AVAssetTrack track in audioTracks AVMutableAudioMixInputParameters..

How to add audio to video file on iphone SDK

http://stackoverflow.com/questions/3440266/how-to-add-audio-to-video-file-on-iphone-sdk

compositionCommentaryTrack insertTimeRange CMTimeRangeMake kCMTimeZero audioAsset.duration ofTrack audioAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 atTime kCMTimeZero error nil AVMutableCompositionTrack compositionVideoTrack mixComposition.. compositionVideoTrack insertTimeRange CMTimeRangeMake kCMTimeZero videoAsset.duration ofTrack videoAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 atTime kCMTimeZero error nil AVAssetExportSession _assetExport AVAssetExportSession alloc..

Reading samples via AVAssetReader

http://stackoverflow.com/questions/4049207/reading-samples-via-avassetreader

asset error error error checking goes here Get the video track s from your asset NSArray video_tracks asset tracksWithMediaType AVMediaTypeVideo AVAssetTrack video_track video_tracks objectAtIndex 0 Set the desired video frame format NSMutableDictionary..

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

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 f size.width size.height..

AVFoundation + AssetWriter: Generate Movie With Images and Audio

http://stackoverflow.com/questions/5640657/avfoundation-assetwriter-generate-movie-with-images-and-audio

AVURLAsset URLAssetWithURL NSURL fileURLWithPath filePath options nil AVAssetTrack videoAssetTrack videoAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVMutableCompositionTrack compositionVideoTrack composition addMutableTrackWithMediaType.. urlAsset AVURLAsset URLAssetWithURL NSURL fileURLWithPath pathString options nil AVAssetTrack audioAssetTrack urlAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 AVMutableCompositionTrack compositionAudioTrack composition addMutableTrackWithMediaType..

Make movie file with picture Array and song file, using AVAsset

http://stackoverflow.com/questions/6061092/make-movie-file-with-picture-array-and-song-file-using-avasset

kCMPersistentTrackID_Invalid a_compositionVideoTrack insertTimeRange video_timeRange ofTrack videoAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 atTime nextClipStartTime error nil nextClipStartTime CMTimeAdd nextClipStartTime a_timeRange.duration.. kCMPersistentTrackID_Invalid b_compositionAudioTrack insertTimeRange audio_timeRange ofTrack audioAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 atTime nextClipStartTime error nil AVAssetExportSession _assetExport AVAssetExportSession..

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

path AVURLAsset asset AVURLAsset URLAssetWithURL url options nil url release AVAssetTrack videoTrack asset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVAssetTrack audioTrack asset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 set.. AVAssetTrack videoTrack asset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 AVAssetTrack audioTrack asset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 set the orientation if i 0 compositionVideoTrack setPreferredTransform videoTrack.preferredTransform.. AVURLAssetPreferPreciseDurationAndTimingKey NSError error nil BOOL ok NO AVAssetTrack sourceVideoTrack sourceAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 CGSize temp CGSizeApplyAffineTransform sourceVideoTrack.naturalSize sourceVideoTrack.preferredTransform..

Application crashed while importing songs from Ipod library in Iphone for iOs 5.0

http://stackoverflow.com/questions/8077725/application-crashed-while-importing-songs-from-ipod-library-in-iphone-for-ios-5

alloc initWithAsset songAsset presetName AVAssetExportPresetPassthrough NSArray tracks songAsset tracksWithMediaType AVMediaTypeAudio AVAssetTrack track tracks objectAtIndex 0 id desc track.formatDescriptions objectAtIndex 0 const AudioStreamBasicDescription.. alloc initWithAsset songAsset presetName AVAssetExportPresetPassthrough NSArray tracks songAsset tracksWithMediaType AVMediaTypeAudio AVAssetTrack track tracks objectAtIndex 0 id desc track.formatDescriptions objectAtIndex 0 const AudioStreamBasicDescription..

Video Encoding using AVAssetWriter - CRASHES

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

aerror nil AVAssetReader reader AVAssetReader alloc initWithAsset avAsset error aerror AVAssetTrack videoTrack avAsset tracksWithMediaType AVMediaTypeVideo objectAtIndex 0 videoWriterInput.transform videoTrack.preferredTransform NSDictionary videoOptions NSDictionary.. audioReader AVAssetReader assetReaderWithAsset avAsset error error retain AVAssetTrack audioTrack avAsset tracksWithMediaType AVMediaTypeAudio objectAtIndex 0 AVAssetReaderOutput readerOutput AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack..