BBMetalImage
BBMetalImage copied to clipboard
How can we play video and audio at the same time?
Hi Silence-Github!
Your Library is so wonderful! But it still have some little issues which is waiting for you to resolve. #63. And also, could you have method that can play video and audio at the same time? In the sample project, at the VideoFilterVC, the audio is just appeared after recording. What about while playing video? I tried to add videoWriter and let it started. But the audio was still not appear. Here's my code in your sample project:
filePath = NSTemporaryDirectory() + "test.mp4"
let outputUrl = URL(fileURLWithPath: filePath)
videoWriter = BBMetalVideoWriter(url: outputUrl, frameSize: BBMetalIntSize(width: 1080, height: 1920))
videoSource.audioConsumer = videoWriter
videoSource
.add(consumer: filter)
.add(consumer: metalView)
videoSource.add(consumer: videoWriter)
videoWriter.start()
videoSource.start()
If your library doesn't have that? I think I'll use the trick: Get the audio from video and play it standalone at the sametime with the video in metalView. Could you have any solution? Thank you for support.
Now the library can not play audio. Maybe you can play audio with AVPlayer.