Closed R3l0ad3d closed 4 years ago
Maybe there is a file with the same outputUrl
, so the video writer can not start writing. Make sure the output url is not used. You can try to remove the file with the same output url before video writer starting.
try? FileManager.default.removeItem(at: videoWriter.url)
thanks its working after add
try? FileManager.default.removeItem(at: videoWriter.url)
another issue i face thats audio . only video play but no sound . how can i solve this . video with audio , and if i want to add extra audio to video how can i add ??
BBMetalVideoWriter
can record video with audio. To play audio, you can use AVPlayer
. There may be a problem for audio playing.
See https://github.com/Silence-GitHub/BBMetalImage/issues/19#issuecomment-540114600
i just copy video writing code from here . but its say "Asset writer can not start writing" . i change only source video url . its play but no write func setup() { // Set up video writer let filePath = NSTemporaryDirectory() + "test.mp4" let outputUrl = URL(fileURLWithPath: filePath) videoWriter = BBMetalVideoWriter(url: outputUrl, frameSize: BBMetalIntSize(width: 1080, height: 1920)) print(outputUrl) // Set up video source let sourceURL = Bundle.main.url(forResource: "video", withExtension: "mp4")! videoSource = BBMetalVideoSource(url: sourceURL)