红红火火恍恍惚惚

IVF容器格式及其muxing overhead

2019-07-22  本文已影响0人  FlyingPenguin

IVF容器格式

Extension: ivf
IVF is a simple file format that transports raw VP8 data.
An IVF file begins with a 32-byte header.
The header is followed by a series of frames. Each frame consists of a 12-byte header followed by data.

image.png

IVF容器的后缀名是.ivf.
用来封装vp8或vp9数据.
其文件头32字节,头之后是一帧一帧数据,帧数据的开头是12字节的帧头。

File Header(32 Bytes)
bytes 0-3    signature: 'DKIF'
bytes 4-5    version (should be 0)
bytes 6-7    length of header in bytes
bytes 8-11   codec FourCC (e.g., 'VP80')
bytes 12-13  width in pixels
bytes 14-15  height in pixels
bytes 16-19  frame rate
bytes 20-23  time scale
bytes 24-27  number of frames in file
bytes 28-31  unused

举例:


Frame Header(12 Bytes)
bytes 0-3    size of frame in bytes (not including the 12-byte header)
bytes 4-11   64-bit presentation timestamp

muxing overhead of IVF

假设ivf文件的大小为ivf_mux_size字节,其中的数据为frame_count帧,那么muxing overhead是多少?

overhead_size = 32 + 12 * frame_count
raw_data_size = ivf_mux_size - overhead_size
muxing_overhead = overhead_size/raw_data_size

References:

https://wiki.multimedia.cx/index.php?title=IVF

上一篇 下一篇

猜你喜欢

热点阅读