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
2
votes
1 answer

AVURLAsset tracks is empty, but video/audio is playable

I have video that lives here: http://195.16.112.71/adaptive/66aebabb-2632-44fc-abf1-df29bca6b941.video/66aebabb-2632-44fc-abf1-df29bca6b941.m3u8 Ffmpeg says that this video has 5 tracks and it's correctly. But if I use AVURLAsset with that link it…
Paltr
  • 135
  • 1
  • 8
2
votes
0 answers

AVURLAsset duration zero in iOS7

I am trying to play video on iPad by using this code. It is okay for iOS 6. But, in iOS 7, its self.asset.duration.value is zero. I would like to know how to do. NSURL *url = [[NSURL alloc] initFileURLWithPath:path]; NSDictionary *options =…
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
2
votes
0 answers

Using the AVURLAsset to play a Remote Video File

I want to use the AVURLAsset to play a video file but on a server not local file. I have read that the AVURLAsset cant be used directly for remote files . I read another link of stack Overflow AVURLAsset cannot load with remote file this link has…
Pankaj Bansal
  • 889
  • 1
  • 12
  • 37
1
vote
1 answer

AVFoundation + GC on Mac OS X

Anybody having trouble using AVFoundation with GC ON??? What I am experiencing is that when accessing the tracks property of an asset, the file stays open by Core Media. Why is this an issue, well because after a long while and opening up many other…
Arvin
  • 2,516
  • 27
  • 30
1
vote
0 answers

The same swift app generates different images from one video on emulator and on a real device. generateCGImagesAsynchronously

The same app generates different images from one video on emulator and on a real device assetImageGenerator.appliesPreferredTrackTransform = true assetImageGenerator.requestedTimeToleranceBefore =…
Postnik
  • 21
  • 1
  • 2
1
vote
1 answer

AVURLAsset loadValuesAsynchronouslyForKeys, synchronous version?

is there a way to load an AVURLAsset in a synchronous manner? My scenario is one which I need to load the assets in the background while showing a different view and change to the view showing the AVPlayer when the assets are ready to play. Not…
nico
  • 9,668
  • 8
  • 26
  • 28
1
vote
0 answers

HTTP2 does not work with AVPlayer in Swift

Currently I'm trying to send the token via headers in Swift but looks like the problem consist in HTTP2. Example: AVURLAsset let headers: [AnyHashable : Any] = [ "content-type": "application/json", "authorization": "Bearer…
1
vote
1 answer

Silence is not adding on end of an audio file

I'm working on a demo of how to add extra silence audio at the end of a given audio file. here my audio file length is 29 sec. & I'm adding 11-sec silence. so, final output audio length will be 40 sec. Here is my function, func…
1
vote
1 answer

Video export failed Show error AVAssetExportSessionStatusFailed

I have tried to find out regarding this issue but didn't find any exact solution for this. NSString *strPath = @"video.mp4"; NSURL *URL = [NSURL fileURLWithPath:strPath]; AVURLAsset *avAsset = [AVURLAsset URLAssetWithURL:URL options:nil]; …
vipinsaini0
  • 541
  • 1
  • 7
  • 26
1
vote
1 answer

AVAsset not working with local file

I'm downloading and caching (using https://github.com/vdugnist/DVAssetLoaderDelegate) videos in my app. When the app starts, I check for a downloaded file, and if it exists, I initialize the asset with the local file, otherwise, I initialize it with…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
1
vote
1 answer

Data contentsOf return nil for URL from AVURLAsset

I wonder why the contentsOf returns nil for URL from AVURLAsset. After picking from the custom library with Photos framework, I tried to request the asset from PHAsset like the following: PHCachingImageManager().requestAVAsset(forVideo: asset,…
Kesong Xie
  • 1,316
  • 3
  • 15
  • 35
1
vote
1 answer

AVFoundation: How can you get the video dimensions of a video being streamed by AVURLAsset?

I need to know if the video I am playing from the web through AVURLAsset is portrait or landscape. In the past I have done this with local videos by getting the video track's natural size, applying its preferred transform, and then comparing width…
Jake G
  • 1,185
  • 9
  • 19
1
vote
0 answers

How to choose best quality thumbnail from a video

Is there a way to generate a good quality thumbnail out of a video. This function I have below generates the first frame of the video as a thumbnail. The problem is usually the thumbnail is pixelated because it doesn't come from a stationary frame…
vApp
  • 249
  • 1
  • 6
  • 18
1
vote
4 answers

Offline HLS Fairplay playback error when the app is closed, code 16227

I'm implementing Offline Playback with HLS Fairplay following the demo in the FairPlay Streaming Server SDK v4.0.1 that uses AVContentSessionKey. I download three contents, each content is downloaded and persisted correctly, both the .movpkg and its…
1
vote
0 answers

(IOS 10) RequestAVAssetForVideo result asset = nil

RequestAVAssetForVideo result nil all the time: iOS 10 (only) (IOS 11 works great) video not recorded on current iPhone video stored in Photo Library Request's localIdentifier = 1BF03030-1CB7-49ED-9314-D0B8D1C34D72/L0/001 assetUrl = nil PHAsset*…
Ofir Malachi
  • 1,145
  • 14
  • 20