rFlex / SCRecorder

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
Apache License 2.0
3.06k stars 583 forks source link

AVCaptureSessionPreset3840x2160 choppy video #254

Closed wholeinsoul closed 8 years ago

wholeinsoul commented 8 years ago

The recorded 4k videos on 6s plus are choppy and pixelated. Tried with various video stabilization modes but same results. Also the resulting video's resolution is 1920x3414 and not 3840x2160.

I'm running the example as it is with session preset changed to 4k. Does this work with 4k videos or are there any known limitations ?

Thank you

wholeinsoul commented 8 years ago

With following changes, I was able to make it work for 4k recording and playback.

  1. changed #define kVideoPreset AVCaptureSessionPreset3840x2160

SCRecoderViewController:viewDidLoad { ... _recorder.captureSessionPreset = kVideoPreset; //[SCRecorderTools bestCaptureSessionPresetCompatibleWithAllDevices]; SCVideoConfiguration *videoCfg = _recorder.videoConfiguration; videoCfg.preset = SCPreset4kQuality; .. }

  1. updated SCVideoConfiguration:createAssetWriterOptionsWithVideoSize { if ([self.preset isEqualToString:SCPreset4kQuality]) { bitrate = 60000000; outputSize = MakeVideoSize(videoSize, 2160); }
  2. updated SCVideoPlayerViewController:saveToCameraRoll { ... exportSession.videoConfiguration.preset = self.recordSession.recorder.videoConfiguration.preset; ... }