piemonte / PBJVision

📸 iOS Media Capture – features touch-to-record video, slow motion, and photography
MIT License
1.94k stars 324 forks source link

How to write video with HEIGHT > WIDTH #305

Closed belakva closed 3 years ago

belakva commented 8 years ago

I am trying to capture video with PBJVision.

I set up camera like this

vision.cameraMode = PBJCameraModeVideo;
vision.cameraOrientation = PBJCameraOrientationPortrait;
vision.outputFormat = PBJOutputFormatWidescreen;

And this produces output where width > height.

Setting orientation to Landscape ROTATES the stream.

I have been trying to record video with GPUImage, and there I can

videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720
cameraPosition:AVCaptureDevicePositionBack];
videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;

_movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:_movieURL size:CGSizeMake(720.0, 1280.0)];

So that i get vertical output.

I would like to achieve vertical output for PBJVision, because IMHO it is much better encapsulated.

What method/property of AVFoundation is responsible for giving the vertical output instead of horizontal?

Sorry for the question, I have been googling 2 days - can't find the answer.