0
私はAVScreenShackの例を参照しています。プレビュー機能を改善しているかどうか確認しました。しかし、フレームスキップは非常に目立ちます。私のコンピュータは十分強力ではないと思っていましたが、QuickTime Playerを使ってスクリーンを記録したとき、ビデオは滑らかでした。OSXのキャプチャ画面でフレームレートが遅くなるのはなぜですか?
高いfps出力を得るために次のコードを改善するにはどうすればよいですか?
func startRecording(){
mSession = AVCaptureSession()
mSession?.sessionPreset = AVCaptureSessionPresetHigh
let displayId : CGDirectDisplayID = CGMainDisplayID()
let session : AVCaptureSession
if mSession != nil {
session = mSession!
}else{
return
}
let input : AVCaptureScreenInput = AVCaptureScreenInput(displayID: displayId)
input.minFrameDuration = CMTimeMake(1, 35)
if let rect = delegate?.cropRect() {
input.cropRect = rect
}
if session.canAddInput(input) {
session.addInput(input)
}else{
return
}
mMovieFileOutput = AVCaptureMovieFileOutput()
if session.canAddOutput(mMovieFileOutput) {
session.addOutput(mMovieFileOutput!)
}
mSession?.startRunning()
mMovieFileOutput?.movieFragmentInterval = kCMTimeInvalid
mMovieFileOutput?.startRecording(toOutputFileURL: URL(fileURLWithPath:"/Users/Tester/Desktop/capture.mov"), recordingDelegate: self)
}
これまでよりもスムーズですが、まだまだ動揺しています。私が理解できない唯一のことは、fpsが24を下回る場合に限り、人間の目はスキップするフレームを検出できることです。ここで何が起こっているのかはっきりしません。 – Bavan
Bavan - ちょうどFYI、それは日付が付いていません(私が子供の頃に聞いたことを覚えています)。この情報源によれば、平均人口は45FPS、60FPS以上を見ることができる人は25%、220FPS以上を検出できる人は(訓練された戦闘機のパイロット)https://www.reddit.com/r/askscience/comments/1vy3qe/how_many_frames_per_second_can_the_eye_see /?st = iqbi33ce&sh = ea892b27あるユーザーは、60FPSでスキップするフレームを検出します。 –