Open hbmtw opened 9 years ago
Is the example working on your device?
try to set _recorder.fastRecordMethodEnabled = false
This seems to happen when a filter property is set on the SCVideoConfiguration of the SCRecorder instance.
Here is some example code in Swift:
func recordTest(){
let recorder = SCRecorder.sharedRecorder()
// Add Filter
let filter = SCFilter(CIFilterName: "CIPhotoEffectInstant")
recorder.videoConfiguration.filter = filter // Addding a filter renders the video black
// Start
recorder.startRunning()
// Record Session
let recordSession = SCRecordSession()
recordSession.fileType = AVFileTypeQuickTimeMovie
recorder.session = recordSession
recorder.record()
// record for 5 seconds
delay(5){
recorder.pause { () -> Void in
recordSession.mergeSegmentsUsingPreset(AVAssetExportPresetHighestQuality, completionHandler: { (url, error) -> Void in
if url != nil {
// Save
url!.saveToCameraRollWithCompletion({ (saved, error) -> Void in
print(saved)
})
}
})
}
}
}
// delay
func delay(delay: Double, closure: Void -> Void) {
dispatch_after(
dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))),
dispatch_get_main_queue(),
closure
)
}
For some reason, SCRecorder is not capturing any video at all. Only audio. I am using Xcode 7.1 with iOS 9.1 on an iPhone 6. When I open the session in SCVideoPlayerViewController, I get a white blank screen with captured audio only. I am using default configuration, and ending the recording with the following:
Anybody experience this?
Thanks for the module! Great work :)