Questions tagged [avurlasset]

This tag should be used for questions about the AVURLAsset class of the AVFoundation framework used in iOS, macOS, and tvOS.

AVURLAsset is a concrete subclass of AVAsset that you use to initialize an asset from an URL.

Complete Class Reference in apple.

112 questions
37
votes
9 answers

AVURLAsset getting video size

This is pretty frustrating. I'm trying to get the size of an AVURLasset, but try to avoid naturalSize since Xcode tells me, this is deprecated in iOS5. But: What's the replacement? I can't find any clue on how to get the video-dimensions without…
Swissdude
  • 3,486
  • 3
  • 35
  • 68
21
votes
4 answers

Is it possible to make AVURLAsset work without a file extension?

I’m trying to create thumbnails for video files: - (UIImage*) thumbnailForVideoAtURL: (NSURL*) videoURL { AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURL options:nil]; AVAssetImageGenerator *generator = [[AVAssetImageGenerator…
zoul
  • 102,279
  • 44
  • 260
  • 354
13
votes
6 answers

AVURLAsset returns duration as 0

I am trying to get the duration of the audio files for trimming them, I am using the below code, audioAsset = [AVURLAsset assetWithURL:itemURL]; CMTime assetTime = [audioAsset duration]; Float64 duration = CMTimeGetSeconds(assetTime); when I…
Rameswar Prasad
  • 1,331
  • 17
  • 35
11
votes
2 answers

How to stream a video with AVURLAsset and save to disk the cached data

Some days ago I was asked to check how difficult is to play a video while downloading it from Internet. I know it's an easy task because someone told me a while ago. So, I checked and it was super easy. The problem was that I wanted to save to disk…
Gabriel.Massana
  • 8,165
  • 6
  • 62
  • 81
11
votes
1 answer

AVPlayer and Progressive Video Downloads with AVURLAssets

We've got an app we're working on that needs to provide playback of video files via AVPlayer. The files need to be stored on the user's device, but also must playback while downloading. At the moment we've built a download module that uses the…
10
votes
2 answers

iPhone SDK. is it possible to rotate videos in AVplayer using AVURLlAsset / AVMutableComposition?

I have a simple video editing view that uses AVPlayer. I create a AVMutableComposition using one or several AVURLAsset. All works fine but the videos are always rotated 90 degrees. i.e. if the source video was taken in portrait mode. AVPlayer shows…
10
votes
1 answer

[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array from AVURLAsset

I tried with following code to merge the audios. AVMutableComposition* composition = [AVMutableComposition composition]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:audioURL options:nil]; AVURLAsset* audioAsset1 = [[AVURLAsset…
jfalexvijay
  • 3,681
  • 7
  • 42
  • 68
8
votes
2 answers

AVAssetResourceLoaderDelegate implementation for an asset of unknown length

My iOS app uses AVPlayer to play streaming audio from my server and storing it on a device. I implemented AVAssetResourceLoaderDelegate, so I could intercept the stream. I change my scheme (from http to a fake scheme, so that…
yeralin
  • 1,357
  • 13
  • 24
8
votes
2 answers

Extract audio from video file

How can I extrace Audio from Video file without using FFmpeg? I want to use AVMutableComposition and AVURLAsset for solving it.e.g. conversion from .mov to .m4a file.
Tripti Kumar
  • 1,559
  • 14
  • 28
7
votes
0 answers

Configure AVAssetCache to store AVURLAsset

I'm trying to access property assetCache from AVURLAsset object, but it's always nil. Documentation provides next information: /*! @property assetCache @abstract Provides access to an instance of AVAssetCache to use for inspection of locally…
Dmitriy Stupivtsev
  • 832
  • 1
  • 8
  • 17
6
votes
1 answer

Switch audio trakcs for AVURLAsset with multiple AVAssetTracks of type audio

I have an AVURLAsset with multiple AVAssetTracks of type audio. I would like to be able to allow user to switch between these different audio track by touching a button. It is working to turn volume of 1st track on and off but other tracks are not…
tiltem
  • 4,952
  • 3
  • 23
  • 26
6
votes
1 answer

AVMutableComposition - Exporting wrong video transform

After exporting VideoAsset: the issues: Video orientation is not original transform Exported Video's layer seems to be always landscape. trying to: transform video layer orientation - rotate to original orientation video layer size - make it full…
Ofir Malachi
  • 1,145
  • 14
  • 20
6
votes
0 answers

AVURLAsset not loading video on documents folder, even using fileURLWithPath

been struggling with this for the past couple of hours, hopefully someone has run into it before I download a file that from a server to my documents folder File is there and valid (checked with iExplorer on device and the local directory of the…
David Homes
  • 2,725
  • 8
  • 33
  • 53
5
votes
2 answers

AVMutableComposition - Blank/Black frame between videos assets

I'm currently trying to put 5 videos back to back using AVMutableComposition like so: [mixComposition insertTimeRange:CMTimeRangeMake(kCMTimeZero, asset1.duration) ofAsset:asset1 atTime:[mixComposition duration] error:nil]; [mixComposition…
5
votes
1 answer

AVURLAsset loadValuesAsynchronouslyForKeys: completionHandler: never fires on device

I'm using next snippet to loadValues synchronously, so loading = NO never fires. And I have the same problem with AVAssetExportSession exportAsynchronously. It's all not working only on device. NSDictionary *options = [NSDictionary…
1
2 3 4 5 6 7 8