LoginSignup
3
3

More than 5 years have passed since last update.

GPUImageVideoCameraにセットされたsessionのサイズの取得(Swift版)

Posted at

AVSessionのinputsからだとうまく取れない。下記のコードで取得可能。

//VideoCameraはGPUIMageVideoCameraのインスタンス

let output = videoCamera.captureSession.outputs[self.videoCamera.captureSession.outputs.endIndex - 1] as! AVCaptureVideoDataOutput
        let setting:NSDictionary = output.videoSettings
        let width  = (setting["Width"] as! NSNumber).longValue
        let height = (setting["Height"] as! NSNumber).longValue

参考
http://stackoverflow.com/questions/18563259/avcapturesession-image-dimensions-with-gpuimage

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3