avurlasset

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

痞子三分冷 提交于 2019-12-01 03:34:37
I tried with following code to merge the audios. AVMutableComposition* composition = [AVMutableComposition composition]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:audioURL options:nil]; AVURLAsset* audioAsset1 = [[AVURLAsset alloc]initWithURL:audioURL1 options:nil]; AVURLAsset* audioAsset2 = [[AVURLAsset alloc]initWithURL:audioURL1 options:nil]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; NSError* error = NULL; [compositionVideoTrack insertTimeRange:CMTimeRangeMake

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

情到浓时终转凉″ 提交于 2019-11-30 23:40:31
问题 I tried with following code to merge the audios. AVMutableComposition* composition = [AVMutableComposition composition]; AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:audioURL options:nil]; AVURLAsset* audioAsset1 = [[AVURLAsset alloc]initWithURL:audioURL1 options:nil]; AVURLAsset* audioAsset2 = [[AVURLAsset alloc]initWithURL:audioURL1 options:nil]; AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID

AVMutableComposition - Blank/Black frame between videos assets

…衆ロ難τιáo~ 提交于 2019-11-29 15:18:03
问题 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 insertTimeRange:CMTimeRangeMake(kCMTimeZero, asset2.duration) ofAsset:asset2 atTime:[mixComposition duration] error:nil]; [mixComposition insertTimeRange:CMTimeRangeMake(kCMTimeZero, asset3.duration) ofAsset:asset3 atTime:[mixComposition duration] error:nil

Extract audio from video file

泪湿孤枕 提交于 2019-11-29 15:14:17
问题 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. 回答1: The following Swift 5 / iOS 12.3 code shows how to extract audio from a movie file ( .mov ) and convert it to an audio file ( .m4a ) by using AVURLAsset , AVMutableComposition and AVAssetExportSession : import UIKit import AVFoundation class ViewController: UIViewController { @IBAction func extractAudioAndExport(_ sender:

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

人走茶凉 提交于 2019-11-28 18:29:42
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 the video to do not force the user to download it again and again. The problem was to access the buffer and store it to disk. Many answers in Stackoverflow says it is nor possible. Specially with videos. My original code to play the video: import AVFoundation .... //MARK: - Accessors lazy var player: AVPlayer = { var player: AVPlayer = AVPlayer

AVURLAsset getting video size

纵然是瞬间 提交于 2019-11-28 10:44:09
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 using «naturalsize»... I just checked the documentation online, and the naturalSize method is deprecated for the AVAsset object. However, there should always be an AVAssetTrack which refers to the AVAsset, and the AVAssetTrack has a naturalSize method that you can call. naturalSize The natural dimensions of the media data referenced by the track. (read

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

烂漫一生 提交于 2019-11-27 11:23:25
问题 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 the video to do not force the user to download it again and again. The problem was to access the buffer and store it to disk. Many answers in Stackoverflow says it is nor possible. Specially with videos. My original code to play the video: import

AVURLAsset getting video size

烈酒焚心 提交于 2019-11-27 03:47:03
问题 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 using «naturalsize»... 回答1: I just checked the documentation online, and the naturalSize method is deprecated for the AVAsset object. However, there should always be an AVAssetTrack which refers to the AVAsset, and the AVAssetTrack has a naturalSize