Saving videos from AVCaptureVideoDataOutput video frames

Thanks to the new video objects in AVFoundation, which are part of iOS4, you can access the raw video frames when they are captured by the camera using AVCaptureVideoDataOutput.

I would like to overlay text and other information on top of these frames, and then output them to a movie file, which at some point will be saved in the asset library.

Unfortunately, it does not seem that Apple has provided us with an easy way to save these frames in a movie file.

What are my options for saving frames to a movie file that will be compatible with the resource library?

Is there a way to do this using only the iPhone SDK?

If not, what third-party libraries are compatible with the iPhone, and can be used for this?

+4
source share
3 answers

I did not find any means to encode frames shot using AVCaptureVideoDataOutput , or write them to the Quicktime.mov file.

You can look at ffmpeg to see if it suits your needs - it can handle both the container format and the encoding.

0
source

AVCaptureMovieFileOutput allows AVCaptureMovieFileOutput to record data in a QuickTime movie, perhaps this helps ...

0
source

Hey! If you just need to make some kind of watermark on your video, then it would just be easy to capture a movie using your camera, and then use the AVVideoCompositionCoreAnimationTool from AVVideoComposition. You can add any kind of animation, texts as an overlay for your video.

0
source

Source: https://habr.com/ru/post/1315544/


All Articles