-
|
Hi, Example setup: func startRecorder() {
let url = URL(fileURLWithPath: NSTemporaryDirectory())
.appendingPathComponent("recorder.mp4")
Task {
try? await recorder.startRecording(url, settings: [
AVMediaType.audio: [AVFormatIDKey: Int(kAudioFormatMPEG4AAC)],
AVMediaType.video: [AVVideoCodecKey: AVVideoCodecType.h264],
])
}
}
final class MonochromeEffect: VideoEffect {
let filter = CIFilter(name: "CIColorMonochrome")!
func execute(_ image: CIImage) -> CIImage {
filter.setValue(image, forKey: "inputImage")
filter.setValue(CIColor(red: 0.75, green: 0.75, blue: 0.75), forKey: "inputColor")
filter.setValue(1.0, forKey: "inputIntensity")
return filter.outputImage!
}
}Currently, the recorder always captures the processed frame (after It would be great to have an option like: recorder.useRawCameraOutput = trueIs there any way to record raw (no effect) video, or could this feature be added? Thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
shogo4405
Oct 5, 2025
Replies: 1 comment 1 reply
-
|
The same functionality has already been implemented. mixer = MediaMixer()
// Assuming that the source is attached as follows:
try? await mixer.attachVideo(front, track: 0)
try? await mixer.attachVideo(back, track: 1)
recorder = StreamRecorder()
// - Specifying 0 selects the front camera
// - Specifying 1 selects the back camera
// - Specifying UInt8.max uses the output from VideoEffect
await recorder.selectTrack(1, mediaType: .video)
mixer.addOutput(recorder) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
noho501
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The same functionality has already been implemented.