H264 Format 方式
来源:互联网 发布:淘宝上战地1那家店好 编辑:程序博客网 时间:2024/06/11 04:29
一、概况介绍
h264有两种封装,
一种是annexb模式(Byte stream format),传统模式,有startcode,SPS和PPS是在ES中
一种是mp4模式(ISO Base Media File Format),一般mp4、mkv、flv会有,没有startcode,SPS和PPS以及其它信息被封装在container中,每一个frame前面是这个frame的长度
lengthSizeMinusOne indicates the length in bytes of the NALUnitLength field in an AVC video
sample or AVC parameter set sample of the associated stream minus one.
很多解码器只支持annexb这种模式,因此需要将mp4做转换:
在ffmpeg中用h264_mp4toannexb_filter可以做转换
实现:
注册filter
avcbsfc = av_bitstream_filter_init("h264_mp4toannexb");
转换bitstream
av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe)
一共有两种起始码:3字节的0x000001和4字节的0x00000001
3字节的0x000001只有一种场合下使用,就是一个完整的帧被编为多个slice的时候,包含这些slice的nalu使用3字节起始码。其余场合都是4字节的。
- H264 Format 方式
- H264 RTP打包方式
- H264 RTP打包方式
- H264 Payload Format over RTP/RTCP
- How to encode video in H264 format
- salesforce开发----Date format方式
- C# string.Format 实用方式
- H264编码方式解析(1)
- H264在网络传输中的打包方式
- h264
- H264
- h264
- h264
- H264
- H264
- H264
- H264
- h264
- leetcode-reverse words in a string
- C++Primer第五版 练习11.31-32(解答)
- POJ 1661 Help Jimmy (DP)
- 可多选的图片选择框
- 第一阶段考核中的JAVA简答题
- H264 Format 方式
- 用GUI实现求两个数的加法--方法一
- HDU 5071 Chat (模拟)
- 最长公共子序列
- 用GUI实现求两个数的加法--方法二
- Android如何获取当前手机的网络状态
- SQL Server 2005的安装
- fmt:formatDate格式化时间
- 数据结构实习二1