Swift: video records at one size but renders at wrong size

雨燕双飞 提交于 2019-11-27 09:26:15
rkyr

If I get you right, it seems that you have misunderstood the fact that device screen width is'n equal to camera preview (and capture) size.

The videoGravity property of your previewLayer indicates how to stretch/fit your preview inside your layer. It doesn't affect capture output.

Actual frame size of output depends on sessionPreset property of your current AVCaptureSession. And as I can understand by reading GitHub repository of PBJVision lib, its singleton has setter for this (called captureSessionPreset). You can change it inside your initPBJVision method.

There you can find possible values of session presets.

Mark Essel

Try SDAVAssetExportSession

You can specify the AVVideoWidthKey and AVVideoHeightKey You can also specify the profile, AVVideoProfileLevelKey ie AVVideoProfileLevelH264HighAutoLevel for supporting something 4k, a friend (Michael Lowin) tracked that property down to help us improve some export qualities.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!