ruanjx / VideoLab

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.
MIT License
845 stars 176 forks source link

怎么样混合背景音乐? #10

Open G-Singularity opened 3 years ago

G-Singularity commented 3 years ago

// 1. Layer 1 var url = Bundle.main.url(forResource: "video1", withExtension: "MOV") var asset = AVAsset(url: url!) var source = AVAssetSource(asset: asset) source.selectedTimeRange = CMTimeRange(start: CMTime.zero, duration: asset.duration) var timeRange = source.selectedTimeRange let renderLayer1 = RenderLayer(timeRange: timeRange, source: source) RenderLayer同样适用音频资源么?有没有demo展示一下?

G-Singularity commented 3 years ago

混合背景音乐后,视频不显示了,需要设置什么参数么?