avmutablecomposition

Loop AVMutableCompositionTrack

六眼飞鱼酱① 提交于 2021-02-17 17:27:29
问题 I have got two audio tracks on me that I combine with one another like this: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; [compositionAudioTrack setPreferredVolume:1.0]; AVAsset *avAsset = [AVURLAsset URLAssetWithURL:originalContentURL options:nil]; AVAssetTrack *clipAudioTrack = [[avAsset tracksWithMediaType

Loop AVMutableCompositionTrack

跟風遠走 提交于 2021-02-17 17:23:44
问题 I have got two audio tracks on me that I combine with one another like this: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; [compositionAudioTrack setPreferredVolume:1.0]; AVAsset *avAsset = [AVURLAsset URLAssetWithURL:originalContentURL options:nil]; AVAssetTrack *clipAudioTrack = [[avAsset tracksWithMediaType

Loop AVMutableCompositionTrack

南笙酒味 提交于 2021-02-17 17:22:07
问题 I have got two audio tracks on me that I combine with one another like this: AVMutableComposition *composition = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; [compositionAudioTrack setPreferredVolume:1.0]; AVAsset *avAsset = [AVURLAsset URLAssetWithURL:originalContentURL options:nil]; AVAssetTrack *clipAudioTrack = [[avAsset tracksWithMediaType

Video with no audio crashes app on AVMutableComposition()

六月ゝ 毕业季﹏ 提交于 2020-12-12 06:07:16
问题 My app takes a video from a URL and allows you to add text to it, etc. It seems to crash when the video doesn't have any audio to begin with, can't seem to figure this out. This is what I have when the video is being composed: let asset = AVAsset(url: URL(string: self.videoURL)!) let mixComposition = AVMutableComposition() let videoTrack = mixComposition.addMutableTrack(withMediaType: .video, preferredTrackID: kCMPersistentTrackID_Invalid) try! videoTrack?.insertTimeRange(CMTimeRangeMake