问题标签 [avcapturemoviefileoutput]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
7800 浏览

ios - ios8 的 AVCaptureSession addInput 问题

我有一个带有 AVCaptureSession 的应用程序,它可以在以前的 iOS 版本中正常工作,但后来我尝试在带有 ios8 的设备上运行它,应用程序偶尔崩溃。但问题没有解决。进入“[session addInput:input];”的异常 . 请指教如何解决。请验证我的以下代码,我在 [session addInput:input] 中遇到错误;

打印错误描述:Error Domain=AVFoundationErrorDomain Code=-11852 "Cannot use Back Camera" UserInfo=0x17c076e0 {NSLocalizedDescription=Cannot use Back Camera, AVErrorDeviceKey=, NSLocalizedFailureReason=This app is not authorized to use Back Camera.}

0 投票
1 回答
1214 浏览

ios - IOS 将 UIProgressView 添加到 AVFoundation AVCaptureMovieFileOutput

AVCaptureMovieFileOutput用来录制视频,我想添加一个UIProgressView来表示在视频停止录制之前还剩多少时间。

我将最大持续时间设置为 15 秒:

我似乎找不到AVCaptureMovieFileOutput视频录制时间或录制开始时间是否有回调。我的问题是,如何获取录制进度的最新信息?或者,如果这不是可用的东西,我如何知道何时开始录制以启动计时器?

0 投票
1 回答
529 浏览

ios - IOS8:录制到文件并使用 AVCaptureSession/commitConfiguration 时相机预览闪烁

从IOS8开始,我在使用commitConfiguration的时候遇到了一个奇怪的问题我们通过AVCaptureMovieFileOutput录制了5秒的文件。更改文件时,相机预览会闪烁并变黑一秒钟。在接收服务器上缝合文件时也会出现口吃。

0 投票
2 回答
2001 浏览

ios - iOS 8 iPad AVCaptureMovieFileOutput 在 13 - 14 秒的录制后丢失/丢失/永远不会获得音轨

我有以下适用于 iOS 6 和 7.x 的代码。

在 iOS 8.1 中,我有一个奇怪的问题,如果您捕获一个会话大约 13 秒或更长时间,生成的 AVAsset 只有 1 个轨道(视频),而音轨不存在。

如果您录制的时间较短,则 AVAsset 有 2 个轨道(视频和音频),如预期的那样。我有足够的磁盘空间,该应用程序有权使用摄像头和麦克风。

我用最少的代码创建了一个新项目,它重现了这个问题。

任何想法将不胜感激。

0 投票
1 回答
224 浏览

ios - iPhone 上的视频录制失败,但可以在 iPod Touch 和 iPad 上使用

场景如下:如果我同时(异步)执行视频录制和视频编辑操作,则这两个操作之一会失败。同一段代码在 iPod Touch 上完美运行,但在 iPhone 上却失败了。

这是编辑视频的代码:

这是用于视频录制的控制器类的代码 (CamViewController.h/.m):

注意:CamViewController课程的灵感来自 Apple 的AVCam示例项目。

0 投票
1 回答
2599 浏览

ios - 如何在 iOS 中为 AvcaptureSession 设置 videoMaximumDuration

我正在使用 AVCaptureSession 录制视频。但我无法设置最大视频长度。如果我使用 ImagePicker 控制器,则有一种方法用于设置最大视频持续时间,如 videoMaximumDuration 。但在 AVCaptureSession 中,我如何设置 MaximumDuration 。请帮助我..提前谢谢

0 投票
0 回答
546 浏览

objective-c - 使用 AVFoundation 录制多个屏幕时出错

我正在尝试使用以下代码将主监视器屏幕和辅助监视器屏幕记录到两个单独的文件中。

我将两个屏幕都保存到两个单独的文件中。但是,在为辅助监视器(即第二次循环)调用 startRecordingToOutputFileURL API 时,我收到如下所示的错误:

VTCompressionSessionCreate 在 /SourceCache/CoreMedia_frameworks/CoreMedia-1562.19/Sources/VideoToolbox/VTCompressionSession.c 第 897 行发出 err=-8973 (err) (VTVideoEncoderStartSession failed)

此外,辅助监视器的压缩参数(比特率)设置不正确,它采用了一些不同的值,而不是我在程序中指定的值。

有人可以帮我吗?也请让我知道这是这样做的正确方法。

提前致谢

乔治

0 投票
2 回答
704 浏览

ios - 如何减小使用 AVCaptureSession 创建的 .mov 视频的文件大小?

我可以使用录制视频AVCaptureSession。但我想减小它的大小。我该怎么做?我URL在委托“captureOutput”方法中得到了最终结果。

0 投票
0 回答
385 浏览

ios - 非常快速的视频捕获(与 AVCaptureMovieFileOutput 相比)?

我正在开发类似于 Vine 或 Instagram 的视频捕获应用程序。这使用户可以按住录制,释放触摸暂停,然后通过触摸再次继续。

我有我的原型工作,我正在捕捉视频,合并它们并很好地裁剪它们。我正在使用AVCaptureMovieFileOutput.

触地时,我开始记录:

在修饰时,我停止:

问题:根据我的日志,似乎在0.054着陆后至少需要几秒钟才能真正开始录制。0.050这意味着不会捕获持续大约几秒钟的非常快速的点击,因为在实际开始之前MovieFileOutput会被告知。stopRecording它可能看起来微不足道,但 Vine 能够捕捉并记录这些敲击声。

有任何想法吗?谢谢

0 投票
0 回答
774 浏览

ios - Can't call startRecordingToOutputFileURL more than once on instance of AVCaptureMovieFileOutput

I am currently testing on iOS 8, on an iPhone 6. I am calling these APIs from Swift.

I'm trying to figure out why I can't call startRecordingToOutputFileURL more than once on a single instance of AVCaptureMovieFileOutput.

  • I am calling stopRecording before I call startRecordingToOutputFileURL again.
  • I am deleting the temporary video file before calling startRecordingToOutputFileURL.

The first time that I call startRecordingToOutputFileURL, the didStartRecordingToOutputFileAtURL delegate callback is fired. When I call stopRecording, the didFinishRecordingToOutputFileAtURL callback is fired.

After this, I delete the temporary file.

Then, when I call startRecordingToOutputFileURL the next time, the delegate callback is not fired. And when I call stopRecording a second time, the "finished" callback is not fired either.

The Apple docs for startRecordingToOutputFileURL say the following:

In iOS, this frame accurate file switching is not supported. You must call stopRecording before calling this method again to avoid any errors.

However, I am calling stopRecording before calling it again, and it is not working.

My current workaround is to remove the AVCaptureMovieFileOutput connection, initialize a new instance of AVCaptureMovieFileOutput, and then set up a new connection. This is terrible, because it takes a long time and freezes the video preview.

Please let me know if you know why this is happening, and if there is a fix.

UPDATE: I just noticed that if I toggle my AVCaptureSession sessionPreset to AVCaptureSessionPresetPhoto and then back to AVCaptureSessionPresetHigh, then I can start capturing video again.

UPDATE 2: Here's another way I can fix the problem:

UPDATE 3: It turns out that this seems to be related to some code that captures the volume buttons - JPSVolumeButtonHandler. It doesn't happen when I comment out the code that starts JPSVolumeButtonHandler.