mp4v2封装函数H264中 MP4WriteSample参数问题
来源:互联网 发布:女装原单淘宝店 编辑:程序博客网 时间:2024/05/23 21:53
Ottavio Campana
“question about MP4AddH264VideoTrack。
What's the meaning of the profile_compat and
sampleLenFieldSizeMinusOne fields?”
Jeremy Noring
"Usually an NALU is prefixed by the start code 0x00000001. To write it
as a sample in MP4 file format, just replace the start code with size
of the NALU(without 4-byte start code) in big endian. You also need to
specify how many bytes of the size value requires. Take libmp4v2 for
example, the last parameter in MP4AddH264VideoTrack(.., uint8_t
sampleLenFieldSizeMinusOne) indicate the number of byes minus one."
...so each sample you and to mp4v2 should be prefixed with a size code
(in big-endian, of course). I use a 4 byte size code, so
sampleLenFieldSizeMinusOne gets set to 3. This seems to work; my
files playback on just about everything. Perhaps one of the project
maintainers can clarify this, and it'd also be good to update the
documentation of that call to make this clear.”
Ottavio Campana
that's the code I used as reference to write my program :-(
but my doubt is that there must be something wrong somewhere, because
boxes seem to be correctly written, but when I try to decode them I
get errors like
[h264 @ 0xb40fa0]AVC: nal size -502662121
have you ever seen an error like this?
Ottavio Campana
> Not sure, but it looks you're not converting it to big-endian before
> prefixing it to your sample.
well, eventually using ffmpeg to dump the read frames, I discovered
that I had to strip che NALU start code, i.e. the 0x00000001, and to
put the NALU size at its place.
It works perfectly now, but I still wonder why I had to put the size
at the begin of the data, since it is a parameter which is passed to
MP4WriteSample, so I expected the function to add it.
所以
(1)h264流中的NAL,头四个字节是0x00000001;
(2)mp4中的h264track,头四个字节要求是NAL的长度,并且是大端顺序;
MP4WriteSample
- mp4v2封装函数H264中 MP4WriteSample参数问题
- 使用mp4v2封装h264裸流
- Mp4v2封装H264+AAC为MP4
- Mp4v2封装H264+AAC为MP4
- MP4V2封装的类库,可将H264和AAC直接打包到MP4容器中,堪称经典
- h264->mp4(mp4v2-android)
- MP4v2获得h264数据
- 使用mp4v2将aac音频h264视频数据封装成mp4开发心得
- 使用mp4v2将aac音频h264视频数据封装成mp4开发心得
- linux下利用mp4v2库将h264和aac文件封装成MP4
- 使用mp4v2将aac音频h264视频数据封装成mp4开发心得
- 转supermanwg的 mpeg4ip的Mp4v2库移植到android系统上,实现h264封装到mp4的容器内
- mpeg4ip的Mp4v2库移植到android系统上,实现h264封装到mp4的容器内
- mpeg4ip的Mp4v2库移植到android系统上,实现h264封装到mp4的容器内
- mpeg4ip的Mp4v2库移植到android系统上,实现h264封装到mp4的容器内
- 7.使用directshow采集视音频并进行H264和ACC实时编码再实时用MP4V2封装成MP4
- MP4V2 录制mp4(h264+aac)视频
- MP4V2 录制mp4(h264+aac)视频
- 飞鸽传书协议分析
- 最常见的读入数据方法集锦
- python 点滴
- 降低图片的内存消耗
- 怎么把pdf文件转换成html格式
- mp4v2封装函数H264中 MP4WriteSample参数问题
- jquery效果
- git常用指令
- Android NDK开发学习(五)
- Android 常用工具类源码大全
- 旗正规则引擎的使用----内存表的json转换
- com和c#的一些笔记
- HttpClient 使用get方式发送数据到服务器并下载服务器文件
- Java基础的片解