从快速MOV文件中解析h.264个NAL单位 [英] Parsing h.264 NAL units from a quicktime MOV file

查看:146
本文介绍了从快速MOV文件中解析h.264个NAL单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图从iPhone上的MOV文件中获取h.264 NAL单位,
以便从iPhone相机到服务器的RTP h.264视频。



Apple的API不允许从相机输出直接访问编码比特流,所以我只能在写入时访问MOV文件。



<根据 Atoms .html#// apple_ref / doc / uid / TP40000939-CH203-BBCGDDDFrel =nofollow> Apple的MOV结构参考但现在我需要从<提取 NAL单位 strong> mdat atom 以便将其打包并转发给RTP。



我很高兴在这里得到一些帮助,因为我找不到文档关于 mdat结构。谢谢!

解决方案

mdat原子是一大堆数据本身没有任何意义。要理解其内容,首先必须解析moov原子。你说你把MOV文件分解成了原子 - 你是不是只挖了moov,mdat,ftyp和其他一些顶级原子?你必须解析moov原子(那里的大量原子)来获得你需要的数据(附加到H.264 stsd原子的额外编解码器数据,它与来自H.264块的数据相结合,这些数据由stco索引或者co64原子)。



或者使用已经完成所有繁琐工作的库。


I'm trying to get h.264 NAL units from a MOV file on the iPhone, in order to RTP h.264 video from the iPhone camera to a server.

Apple's API does not allow direct access to the encoded bitstream from the camera output, so I can only access the MOV file, while it's being written.

I've parsed the MOV file into Atoms, according to Apple's MOV structure reference but now i need to extract the NAL units from the mdat atom in order to pack it to RTP and stream it.

I'd be glad for some help here because i can't find documentation about the mdat structure. Thanks!

解决方案

The mdat atom is a big blob of data that makes no sense on its own. To understand its contents, one must first parse the moov atom. You said that you decomposed the MOV files into atoms-- did you dig deeper than just moov, mdat, ftyp, and a few other top-level atoms? You have to parse the moov atom (lots of atoms in there) to get the data you need (extra codec data attached to the H.264 stsd atom which is combined with data from the H.264 chunks, which are indexed by the stco or co64 atoms).

Or use a library that already does all the tedious work for you.

这篇关于从快速MOV文件中解析h.264个NAL单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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