使用AVFoundation在时域中记录位置 [英] Recording locations in time domain with AVFoundation

查看:83
本文介绍了使用AVFoundation在时域中记录位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了很多教程,而有关在AVFoundation中进行录制的每个教程都只记录了视频或音频或这两者.

I followed a lot of tutorials and every tutorials about recording in AVFoundation covers only recording Video or Audio or both of this things.

我想在同一时域中录制一些位置,例如在单独的轨道上录制视频/音频.仅使用5个属性(即纬度,经度,海拔高度,开始时间,持续时间)来描述此位置路标,并且记录的5秒不会频繁更改.这段录音仅供演示之用,我需要一些功能,例如流媒体,播放,跳过,暂停.

I would like to record some location in the same time domain like Video/Audio on separate track. This location waypoints is described with 5 properties only - latitude, longitude, altitude, startTime, duration and it'll be changing no often that 5 seconds of the recording. This recording is for presentation purposes and I need functionality such as streaming, play forward, skipping, pause.

有人知道如何使用AVFoundation框架吗?

Anybody have some idea how to do it with AVFoundation framework?

推荐答案

当然可以.

AVFoundation是上层和下层库的集合,具有许多选项,可在各个阶段进入处理管道.假设您要从Camera捕获,则将使用AVCaptureSession的某种组合,其委托 https://developer.apple.com/reference/avfoundation/avcapturevideodataoutputsamplebufferdelegate 和AVAssetWriter.

AVFoundation is a collection of higher and lower level libraries with lots of options to tap into the processing pipeline at various stages. Assuming you want to capture from the Camera, then you're going to be using some combination of AVCaptureSession, its delegate https://developer.apple.com/reference/avfoundation/avcapturevideodataoutputsamplebufferdelegate and an AVAssetWriter.

AVCaptureVideoDataOutputSampleBufferDelegate正在捕获售卖的CMSampleBuffers(它们将视频数据帧与定时信息结合在一起),在您接收到这一点时,您通常只是写出" CMSampleBuffer来记录视频,但是您也可以对其进行进一步处理对其进行实时过滤,或者根据需要记录其他信息以及定时数据(例如,在视频的这一点上,我有了这些坐标).

The AVCaptureVideoDataOutputSampleBufferDelegate is capturing vended CMSampleBuffers (which combine a frame of video data with timing information), at the point you receive it, you typically just "write out" the CMSampleBuffer to record the video, but you can also further process it to filter it in realtime or, as you want to do, record additional information with timing data (e.g. at this point in the video, I had these coordinates).

研究如何在iOS上使用摄像头编写视频以开始使用并使用Delegate,您将很快看到将代码插入何处以实现所需的功能.

Research how to write video from the camera on iOS to get started and using the Delegate, you'll soon see where to hook into the code to achieve what you're after.

这篇关于使用AVFoundation在时域中记录位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆