¡@

Home 

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

iphone Programming Glossary: asset

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

you can get the thumbnail at any time in the example its at time 0 void generateImage AVURLAsset asset AVURLAsset alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator.. self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0.. AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail.. reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage.. reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage..

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

AVChannelLayoutKey nil AVAssetWriterInput videoWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeVideo outputSettings videoSettings retain AVAssetWriterInput audioWriterInput.. outputSettings videoSettings retain AVAssetWriterInput audioWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeAudio outputSettings audioSettings retain NSURL fileURL NSBundle.. NSBundle mainBundle URLForResource @ Big_Voice_1 withExtension @ caf NSLog @ @ fileURL AVAsset asset AVURLAsset URLAssetWithURL fileURL options nil retain AVAssetReader audioReader AVAssetReader assetReaderWithAsset..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

kCVPixelBufferWidthKey NSNumber numberWithInt videoSize.height kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput.. kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary.. AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary Once I have that I..

Get Exif data from UIImage - UIImagePickerController

http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller

delegate method ALAssetsLibrary library ALAssetsLibrary alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation.. library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image.. resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image data uint8_t buffer Byte malloc image_representation.size..

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

the class property url is the movie url will do the trick you can get the thumbnail at any time 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.. generateImage AVURLAsset asset AVURLAsset alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime.. initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime CGImageRef im CMTime actualTime AVAssetImageGeneratorResult..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

CellIdentifier if cell nil cell UITableViewCell alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage asset.. nil cell UITableViewCell alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage asset thumbnail cell.textLabel setText NSString.. UITableViewCell alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage asset thumbnail cell.textLabel setText NSString..

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

NSData dataWithBytes channelLayout length sizeof AudioChannelLayout AVChannelLayoutKey nil AVAssetWriterInput videoWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeVideo outputSettings videoSettings retain AVAssetWriterInput audioWriterInput AVAssetWriterInput assetWriterInputWithMediaType.. assetWriterInputWithMediaType AVMediaTypeVideo outputSettings videoSettings retain AVAssetWriterInput audioWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeAudio outputSettings audioSettings retain NSURL fileURL NSBundle mainBundle URLForResource @ Big_Voice_1 withExtension @ caf.. outputSettings audioSettings retain NSURL fileURL NSBundle mainBundle URLForResource @ Big_Voice_1 withExtension @ caf NSLog @ @ fileURL AVAsset asset AVURLAsset URLAssetWithURL fileURL options nil retain AVAssetReader audioReader AVAssetReader assetReaderWithAsset asset error error retain AVAssetWriterInputPixelBufferAdaptor..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

NSNumber numberWithInt videoSize.width kCVPixelBufferWidthKey NSNumber numberWithInt videoSize.height kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes.. NSNumber numberWithInt videoSize.height kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary Once I have that I configure.. kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary Once I have that I configure the FBO that I'll be rendering my video frames to..

Get Exif data from UIImage - UIImagePickerController

http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller

And put this inside your imagePickerController didFinishPickingMediaWithInfo delegate method ALAssetsLibrary library ALAssetsLibrary alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create.. method ALAssetsLibrary library ALAssetsLibrary alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image data uint8_t buffer Byte malloc image_representation.size NSUInteger.. alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image data uint8_t buffer Byte malloc image_representation.size NSUInteger length image_representation getBytes buffer..

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

url will do the trick you can get the thumbnail at any time in the example its at time 0 void generateImage AVURLAsset asset AVURLAsset alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset.. alloc initWithURL self.url options nil AVAssetImageGenerator generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler.. generator AVAssetImageGenerator alloc initWithAsset asset generator.appliesPreferredTrackTransform TRUE asset release CMTime thumbTime CMTimeMakeWithSeconds 0 30 AVAssetImageGeneratorCompletionHandler handler ^ CMTime requestedTime..

Adjusting the volume of a playing AVPlayer

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

change on currently playing AVPlayer items is to follow this process Offload the currently playing AVPlayerItem's asset Grab the current playback time for that AVPlayerItem Load the asset into a new AVPlayerItem Replace the current AVPlayerItem.. Offload the currently playing AVPlayerItem's asset Grab the current playback time for that AVPlayerItem Load the asset into a new AVPlayerItem Replace the current AVPlayerItem with the new one Wait for the currentItem to change on the AVPlayer.. you like and you can set it after the audio is playing. For example assuming your instance of AVAsset is called asset your instance of AVPlayerItem is called playerItem and the volume you want to set is called volume the following code should..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

cell UITableViewCell alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView.. UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage asset.. reuseIdentifier CellIdentifier autorelease here 'asset' represents the ALAsset object asset assets objectAtIndex indexPath.row i am accessing the thumbnail here cell.imageView setImage UIImage imageWithCGImage asset thumbnail..

iPhone:Programmatically compressing recorded video to share?

http://stackoverflow.com/questions/5687341/iphoneprogrammatically-compressing-recorded-video-to-share

library ALAssetsLibrary alloc init autorelease ALAssetsLibraryWriteVideoCompletionBlock completionBlock ^ NSURL assetURL NSError error NSLog @ Saved URL @ assetURL NSLog @ Error @ error if assetURL nil AVURLAsset theAsset AVURLAsset URLAssetWithURL.. ALAssetsLibraryWriteVideoCompletionBlock completionBlock ^ NSURL assetURL NSError error NSLog @ Saved URL @ assetURL NSLog @ Error @ error if assetURL nil AVURLAsset theAsset AVURLAsset URLAssetWithURL NSURL URLWithString videoURL options.. completionBlock ^ NSURL assetURL NSError error NSLog @ Saved URL @ assetURL NSLog @ Error @ error if assetURL nil AVURLAsset theAsset AVURLAsset URLAssetWithURL NSURL URLWithString videoURL options nil NSArray compatiblePresets..

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

length sizeof AudioChannelLayout AVChannelLayoutKey nil AVAssetWriterInput videoWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeVideo outputSettings videoSettings retain AVAssetWriterInput audioWriterInput AVAssetWriterInput.. AVMediaTypeVideo outputSettings videoSettings retain AVAssetWriterInput audioWriterInput AVAssetWriterInput assetWriterInputWithMediaType AVMediaTypeAudio outputSettings audioSettings retain NSURL fileURL NSBundle mainBundle URLForResource.. retain NSURL fileURL NSBundle mainBundle URLForResource @ Big_Voice_1 withExtension @ caf NSLog @ @ fileURL AVAsset asset AVURLAsset URLAssetWithURL fileURL options nil retain AVAssetReader audioReader AVAssetReader assetReaderWithAsset asset..

Faster alternative to glReadPixels in iPhone OpenGL ES 2.0

http://stackoverflow.com/questions/9550297/faster-alternative-to-glreadpixels-in-iphone-opengl-es-2-0

videoSize.width kCVPixelBufferWidthKey NSNumber numberWithInt videoSize.height kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput.. videoSize.height kCVPixelBufferHeightKey nil assetWriterPixelBufferInput AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary.. AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput assetWriterVideoInput sourcePixelBufferAttributes sourcePixelBufferAttributesDictionary Once I have that I configure the FBO that..

Get Exif data from UIImage - UIImagePickerController

http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller

didFinishPickingMediaWithInfo delegate method ALAssetsLibrary library ALAssetsLibrary alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation.. alloc init library assetForURL info objectForKey UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image data uint8_t buffer.. UIImagePickerControllerReferenceURL resultBlock ^ ALAsset asset ALAssetRepresentation image_representation asset defaultRepresentation create a buffer to hold image data uint8_t buffer Byte malloc image_representation.size NSUInteger..

'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format'

http://stackoverflow.com/questions/18736954/missing-recommended-icon-file-the-bundle-does-not-contain-an-app-icon-for-iph

expecting . Xcode 5 app icon Manage If you are using xCode5 The first thing to update is the icons. Xcode 5 introduces Asset Catalogs to simply managing multiple copies of an image such as for multiple resolutions . We ™ll create one to manage both.. resolutions . We ™ll create one to manage both the Game ™s icons along with the Launch Images. Now click the Use Asset Catalog button. When confirming the migration you ™re also asked if you wish to migrate the Launch Images which is iOS talk..

Localize Asset Catalogs

http://stackoverflow.com/questions/18814801/localize-asset-catalogs

Asset Catalogs I know it's a new feature and this may not be possible but I would like to be able to localize an Asset Catalog.. Asset Catalogs I know it's a new feature and this may not be possible but I would like to be able to localize an Asset Catalog in different languages to show a localized launch image. This was possible on XCode 4 simply localizing an image.. xcode5 share improve this question You may localize the catalog as you localize everything else copy or drag the Asset catalog folder into your langue .lproj folder update the reference of your asset file in your Xcode project Now you may..

iOS 7: Proper iPad icons for iPhone app?

http://stackoverflow.com/questions/19312080/ios-7-proper-ipad-icons-for-iphone-app

this question Took me a while to work this one out as I was having the same issue. If you highlight your AppIcon Asset group when looking at it in Xcode you can add additional fields to it by opening the inspector right hand pane and clicking..

AVAsset and AVAssetTrack - Track Management in IOS 4.0

http://stackoverflow.com/questions/3298290/avasset-and-avassettrack-track-management-in-ios-4-0

and AVAssetTrack Track Management in IOS 4.0 The new features list of IOS 4.0 says that AV Foundation framework has got.. and AVAssetTrack Track Management in IOS 4.0 The new features list of IOS 4.0 says that AV Foundation framework has got Media asset.. composition AVMutableComposition composition This will hold your videos. Now you have an empty Composition Asset. Add some files from your directory or from the web NSURL sourceMovieURL NSURL fileURLWithPath moviePath AVURLAsset sourceAsset..

Accessing Videos in library using AssestsLibrary framework iPhone?

http://stackoverflow.com/questions/3948485/accessing-videos-in-library-using-assestslibrary-framework-iphone

Videos in library using AssestsLibrary framework iPhone i am trying to access videos in iPhone library using AssetsLibrary Framework with the help of following code...but when i run the application the code is not working...the array assets.. upgraded to iPhone 4.1. but assets framework is not giving any error NSMutableArray assets NSMutableArray alloc init ALAssetsLibrary library ALAssetsLibrary alloc init void ^assetEnumerator struct ALAsset NSUInteger BOOL ^ ALAsset result NSUInteger.. but assets framework is not giving any error NSMutableArray assets NSMutableArray alloc init ALAssetsLibrary library ALAssetsLibrary alloc init void ^assetEnumerator struct ALAsset NSUInteger BOOL ^ ALAsset result NSUInteger index BOOL stop if result..

CoreAnimation, AVFoundation and ability to make Video export

http://stackoverflow.com/questions/5031721/coreanimation-avfoundation-and-ability-to-make-video-export

that AV Foundation have the ability to merge or recombine videos and also to add audio track building a single video Asset. Now ... my goal is a little bit different. I would to create a video from scratch. I have a set of UIImage and I need to.. NSArray arrayWithObject videoCompositionInstruction 3 I export the video to document path AVAssetExportSession session AVAssetExportSession alloc initWithAsset composition presetName AVAssetExportPresetLowQuality session.videoComposition.. arrayWithObject videoCompositionInstruction 3 I export the video to document path AVAssetExportSession session AVAssetExportSession alloc initWithAsset composition presetName AVAssetExportPresetLowQuality session.videoComposition videoComposition..

Upload ALAsset URL images to the server

http://stackoverflow.com/questions/5442653/upload-alasset-url-images-to-the-server

ALAsset URL images to the server I am trying to access iPhone's photo album photo images through ALAssetsLibrary and upload send.. ALAsset URL images to the server I am trying to access iPhone's photo album photo images through ALAssetsLibrary and upload send the images to my server. I am being successful accessing the photo album and get the asset URL of.. the asset URL of each images via the following code void viewDidLoad super viewDidLoad void ^assetEnumerator struct ALAsset NSUInteger BOOL ^ ALAsset result NSUInteger index BOOL stop if result NULL NSLog @ See Asset @ result assets addObject..

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

movie file with picture Array and song file using AVAsset I'm trying to make movie file using a picture array and an audio file. To make movie with a picture array i used the big.. NSString stringWithFormat @ @ @ documentsDirectoryPath tString error nil NSLog @ Write Started NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL NSURL fileURLWithPath path fileType AVFileTypeMPEG4 error error NSParameterAssert.. @ @ @ documentsDirectoryPath tString error nil NSLog @ Write Started NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL NSURL fileURLWithPath path fileType AVFileTypeMPEG4 error error NSParameterAssert videoWriter..

Video Encoding using AVAssetWriter - CRASHES

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

Encoding using AVAssetWriter CRASHES I have a function that is supposed to re encode a video to a manageable bitrate on iphone ipad. Here it is.. NSURL fileURLWithPath newName NSURL path NSURL fileURLWithPath pathy NSLog @ Write Started NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL fullPath fileType AVFileTypeQuickTimeMovie error error NSParameterAssert.. newName NSURL path NSURL fileURLWithPath pathy NSLog @ Write Started NSError error nil AVAssetWriter videoWriter AVAssetWriter alloc initWithURL fullPath fileType AVFileTypeQuickTimeMovie error error NSParameterAssert videoWriter AVAsset avAsset..

how to upload a audio file from iphone documents folder to server

http://stackoverflow.com/questions/9867340/how-to-upload-a-audio-file-from-iphone-documents-folder-to-server

type Where path is asset.path if assetIndex assets count 1 while assetIndex assets count 1 assetIndex 1 Asset asset assets objectAtIndex assetIndex NSData data NSData dataWithContentsOfFile asset.path iphone objective c share..

What is the correct way to import & save Photos from iPhone Album?

http://stackoverflow.com/questions/9973259/what-is-the-correct-way-to-import-save-photos-from-iphone-album

from the iPhone Album to the documents folder of my application. This is my code. for int j 0 j assetArray count j ALAsset assest assetArray objectAtIndex j CGImageRef imageRef assest.defaultRepresentation.fullResolutionImage UIImage image UIImage.. from the imagefile ImageIO creates first a CGImageRef that is then converted to a JPEG. This takes time. The AssetLibrary can also contain videos. In such a case fullResolutionImage only returns a previewImage of the video but not the.. only returns a previewImage of the video but not the actual video. It's no problem to store the actual Asset Objects as these are small in memory. A far better approach to write out the images to the documents directory would be..