如何读取mov文件的文件头 [英] How can I read the file header of mov file

查看:182
本文介绍了如何读取mov文件的文件头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道是谁阅读.mov视频文件的标题。

所以,任何人都可以帮忙解决这个问题



我尝试过:



我只知道.MOV视频文件的研究,但不知道后端编码

I really don't know who to read the header of .mov video file .
So,can anybody can help regarding this

What I have tried:

I just know the research of the .MOV video file but don't know the Backend coding

推荐答案

首先,您需要文件格式规范。请参阅 QuickTime文件格式 - 维基百科 [ ^ ]以获取概述和历史记录以及 QuickTime文件格式规范 [ ^ ]供参考。



根据参考资料, QuickTime 文件使用atoms指定数据块。每个 atom 以4字节大小字段开始,后跟类型字段。因此,您可以逐步读取文件大小和类型,可选地处理以下数据并在下一个原子处继续,方法是将大小添加到文件位置。



要读取文件,请使用支持搜索的任何C / C ++文件库函数(例如 fopen() fread() fseek() fclose())。



如果您需要进一步处理 QuickTime 文件,我建议您使用库而不是自己动手。示例可以是 GStreamer [ ^ ]和 FFmpeg [ ^ ]。
At first you need the file format specification. See QuickTime File Format - Wikipedia[^] for an overview and history and the QuickTime File Format Specification[^] for the reference.

According to the reference, QuickTime files use "atoms" to specify data blocks. Each atom begins with a 4 byte size field followed by a type field. So you can step through the file reading the size and type, optionally process the following data and resume at the next atom by adding the size to the file position.

To read the file use any C/C++ file library functions that support seeking (e.g. fopen(), fread(), fseek(), fclose()).

If you need further processing of QuickTime files I suggest to use a library rather than doing it yourself. Examples may be GStreamer[^] and FFmpeg[^].


这篇关于如何读取mov文件的文件头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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