avurlasset

“Other Processes” untraceable memory leaks when using AVAssetResourceLoaderDelegate, iOS Objective C

不问归期 提交于 2020-05-17 06:01:35
问题 I am trying to create an AVURLAsset from an mp4 in memory. So I have created an implementation of AVAssetResourceLoaderDelegate. @interface RLDelegate : NSObject <AVAssetResourceLoaderDelegate> - (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType; @end @interface RLDelegate() @property (nonatomic) NSData *data; @property (nonatomic) NSString *contentType; @end @implementation RLDelegate - (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType

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

两盒软妹~` 提交于 2019-12-24 14:23:34
问题 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 content key on the documents directory, when I turn off the WIFI these three contents downloaded plays correctly without any problems, before playing Im using this code: let urlAsset = element.urlAsset! ContentKeyManager.shared.contentKeySession

AVMutableComposition - Exporting wrong video transform

一曲冷凌霜 提交于 2019-12-22 05:16:30
问题 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 screen size (by original orientation) some notes: videoAsset's CGRect is opposite from beginning. after export, video transform is wrong tried to rotate with no success for full size layer AVURLAsset*videoAsset = [[AVURLAsset alloc]initWithURL:url

Why can't I extract data from media file using AVURLAsset in a Playground?

北战南征 提交于 2019-12-14 03:50:00
问题 In my Playground: import Cocoa import Foundation import AVFoundation var path2 = "/Users/me/Movies/bukesiyi.mp4" var video2 = NSURL(fileURLWithPath: path2, isDirectory: false) // it shows: file:///Users/me/Movies/bukesiyi.mp4 video2.checkResourceIsReachableAndReturnError(nil) // it's true var asset = AVURLAsset(URL: video2) // it shows: <AVURLAsset: 0x7fc0a9f13500, URL = file:///Users/me/Movies/bukesiyi.mp4> asset.tracksWithMediaType(AVMediaTypeVideo) // it's [] asset.readable // it's false

How to get video duration in Document Directory

守給你的承諾、 提交于 2019-12-11 15:22:22
问题 It might be duplicate question but I spent to much time for solution. I download a mp4 file to documentary directory. I can get all file names with this function: func listFilesFromDocumentsFolder() -> [String]? { let fileMngr = FileManager.default; let docs = fileMngr.urls(for: .documentDirectory, in: .userDomainMask)[0].path return try? fileMngr.contentsOfDirectory(atPath:docs) } And I want to get all of these file's time length. Let me show what I try: var downs =

AVURLAsset not loading video on documents folder, even using fileURLWithPath

安稳与你 提交于 2019-12-07 06:05:38
问题 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 simulator). Moved each file to my desktop and plays without problems. The strange thing is that the exact same code works without issues when the file (the same video) is added to the bundled. code: print("video url string : \(video.urlString)") //

I cannot get a precise CMTime for Generating Still Image from 1.8 second Video

若如初见. 提交于 2019-12-06 03:21:59
问题 Every time I try to generate a still frame from my video asset, it is generated at a time of 0.000.. seconds. I can see this from my log message. The good thing is that I can get the image at time 0.000.. to show up in a UIImageView called "myImageView." I thought the problem was that AVURLAssetPreferPreciseDurationAndTimingKey was not set, but even after I figured out how to do that, it still does not function.. Here is what I have.. time, actualTime, and generate are declared in the Header

AVMutableComposition - Exporting wrong video transform

三世轮回 提交于 2019-12-05 07:53:00
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 screen size (by original orientation) some notes: videoAsset's CGRect is opposite from beginning. after export, video transform is wrong tried to rotate with no success for full size layer AVURLAsset*videoAsset = [[AVURLAsset alloc]initWithURL:url options:nil]; AVMutableComposition* mixComposition = [AVMixerBase compositionVideoTrackAssetUrl

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

此生再无相见时 提交于 2019-12-03 09:06:18
问题 I’m trying to create thumbnails for video files: - (UIImage*) thumbnailForVideoAtURL: (NSURL*) videoURL { AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURL options:nil]; AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset]; CGImageRef imageHandle = [generator copyCGImageAtTime:kCMTimeZero actualTime:NULL error:NULL]; if (imageHandle) { UIImage *frameImage = [UIImage imageWithCGImage:imageHandle]; CFRelease(imageHandle); return frameImage; } else {

AVPlayer and Progressive Video Downloads with AVURLAssets

烂漫一生 提交于 2019-12-03 07:28:26
问题 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 ASIHTTPRequest library to get the video files via PHP (we don't want the media to be linkable via public URLs) and write them to disk asynchronously. We've then setup an AVPlayer as per the AV Foundation Programming Guide, getting the file with