具有流式H.264样本的AVAssetReader

时间:2022-10-17 08:42:14

I'm writing an RTSP/H.264 client. Live555 for parsing the RTSP is great, but using ffmpeg for software decoding is just too slow. I'd like to use AVFoundation to hardware decode the samples. I'm not sure how to do this. My question is, is there any way to get AVFoundation (AVAssetReader?) to decode these samples as they come in and display the feed on-screen?

我正在编写RTSP / H.264客户端。用于解析RTSP的Live555非常棒,但使用ffmpeg进行软件解码的速度太慢了。我想使用AVFoundation对样本进行硬件解码。我不知道该怎么做。我的问题是,有没有办法让AVFoundation(AVAssetReader?)解码这些样本,因为它们进来并在屏幕上显示Feed?

2 个解决方案

#1


3  

From now the media sample encoded with H264 comes from memory can't use hardware decode, because iOS doesn't open these interfaces, you can only decode local file or by HTTP Live Streaming. However, there is a possible solution that write every sample into a separate mp4 file, then read it with AVAssetReader, but I didn't try that, maybe speed is a limit.

从现在开始用H264编码的媒体样本来自内存不能使用硬件解码,因为iOS不打开这些接口,你只能解码本地文件或通过HTTP Live Streaming。但是,有一种可能的解决方案是将每个样本写入一个单独的mp4文件,然后用AVAssetReader读取它,但我没有尝试,可能速度是一个限制。

#2


0  

This may at least get you started

这至少可以让你开始

https://github.com/mooncatventures-group/FFPlayer-tests

https://github.com/mooncatventures-group/FFPlayer-tests

#1


3  

From now the media sample encoded with H264 comes from memory can't use hardware decode, because iOS doesn't open these interfaces, you can only decode local file or by HTTP Live Streaming. However, there is a possible solution that write every sample into a separate mp4 file, then read it with AVAssetReader, but I didn't try that, maybe speed is a limit.

从现在开始用H264编码的媒体样本来自内存不能使用硬件解码,因为iOS不打开这些接口,你只能解码本地文件或通过HTTP Live Streaming。但是,有一种可能的解决方案是将每个样本写入一个单独的mp4文件,然后用AVAssetReader读取它,但我没有尝试,可能速度是一个限制。

#2


0  

This may at least get you started

这至少可以让你开始

https://github.com/mooncatventures-group/FFPlayer-tests

https://github.com/mooncatventures-group/FFPlayer-tests