从iOS 10开始,当AVAssetExportSession处于活动状态时,AVPlayer播放失败 [英] AVPlayer playback fails while AVAssetExportSession is active as of iOS 10

查看:112
本文介绍了从iOS 10开始,当AVAssetExportSession处于活动状态时,AVPlayer播放失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AVPlayer将随机播放音频,而不显示视频轨道...

AVPlayer will randomly just play audio, not showing the video track...

有效压缩会话为AVAssetExportSession:exportAsynchronouslyWithCompletionHandler时,用AVPlayer正确播放视频现在失败.看来,这种不稳定性会一直存在,直到应用程序进入后台并重新出现为止.

Playing video correctly with AVPlayer while having an active compression session of AVAssetExportSession:exportAsynchronouslyWithCompletionHandler is now failing. It seems it causes some instability that persists until the app goes into the background and comes back.

检查AVURLAsset,当视频播放失败时,即使没有视频输出,也存在视频轨道.我也没有从压缩器或其他播放组件中得到任何错误...即使在压缩会话返回后的一段时间内,也会发生此问题.

Examining AVURLAsset when video playback fails, there is a video track even though there is no video output. I also don't get any errors from the compressor or the other playback components... The problem happens even for a while after the compression session has returned.

我尝试过以不同方式进行单独的线程处理,但没有成功.

I've tried separate threading in different ways with no success.

从iOS 10开始,似乎正在发生某些事情,这导致两个进程之间发生某种冲突...

It seems that as of iOS 10 there is something going on under the hood that causes some sort of conflict between both processes...

推荐答案

从Apple DTS听到.他们还同意这指向一个Apple iOS错误,并要求我对其进行记录.

Just heard from Apple DTS. They also agree this points to an Apple iOS bug and asked me to log it.

我完全取消了AVAssetExportSession的使用,它解决了这个问题.因此,将AVAssetExportSession与其他AV方法结合使用会导致iOS不稳定.

I cut out usage of AVAssetExportSession altogether and it solved the issue. So calling AVAssetExportSession in combination with other AV methods is what causes the iOS instability.

在我的情况下,我正在使用AVAssetExportSession进行后期捕获压缩.因此,我改为使用AVAssetWriter以所需的格式实时采样每一帧...

In my case I was usingAVAssetExportSession for post capture compression. So instead I used AVAssetWriter to sample each frame in real-time to the format I needed...

希望苹果很快会解决此问题.

This should be fixed soon by Apple, hopefully.

这篇关于从iOS 10开始,当AVAssetExportSession处于活动状态时,AVPlayer播放失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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