AVCaptureVideoPreviewLayer: taking a snapshot

前端 未结 4 1790
不知归路
不知归路 2020-12-14 03:53

I\'m trying to emulate the animation seen in the default camera app, where a snapshot of the cameras viewfinder is animated into the corner of the apps display.

The

4条回答
  •  情歌与酒
    2020-12-14 04:24

    there are 2 ways to grab frames of the preview.. AVCaptureVideoDataOutput & AVCaptureStillImageOutput :)

    is your capture session is setup to grab video frames, then make your layer with the cgimage from a chosen frame. if it's setup for stills, wait until getting your still image and make your layer from a scaled down version of that cgimage. if you don't have an output on your session yet, you'll have to add one i think.

提交回复
热议问题