2

Is there a way to set a custom AVCaptureVideoDataOutput for a desired output setting. What Im trying to achieve is below. However the buffer width and height never change .What Im trying to achieve is a custom height and a width for the video pixel output. What am I missing ?

   AVCaptureVideoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey: Int(kCVPixelFormatType_32BGRA),
                                          kCVPixelBufferHeightKey: 300,
                                          kCVPixelBufferWidthKey: 300] as [String : Any]

Thus, I tried with the same objective with the session preset, but they are not capable of setting a custom width and height. If I can get a 300x300 output thats a win

danu
  • 1,079
  • 5
  • 16
  • 48

1 Answers1

0

You won't get any change in video dimensions use Presets

if it doesn't fit your need use this NextLevelSessionExporter

to resize the video with or without aspect fit of the original record dimensions

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • Im intend not to use 3rd parties, is there a way to override kCVPixelBufferHeightKey – danu Aug 10 '21 at 14:36