annexb avcc
目錄annex-b系:傳統派avcc系:現代派針對avpacket使用,而不是其他數據結構轉換為annexb :
Convert an H.264 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.264 specification).
This is required by some streaming formats, typically the MPEG-2 transport stream format (muxer mpegts).
annex-b系:傳統派
annex-b格式 bitstream === 起始碼前綴模式
利用startcode,分割nalu
pps sps存儲在es中
流媒體直播使用格式, 比如常用格式有ts
avcc系:現代派
avc- c格式 container ==== 長度前綴模式
使用長度分割nalu
pps sps存儲在container中
介質存儲使用格式, 比如 flv mp4 mkv
針對avpacket使用,而不是其他數據結構
h264使用的過濾器:h264_mp4toannexb
h265使用的過濾器:hevc_mp4toannexb
static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out);
static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out);
轉換為annexb :
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
filter = av_bsf_get_by_name("h264_mp4toannexb");
if (!filter) {
av_log(avf, AV_LOG_ERROR, "h264_mp4toannexb bitstream filter "
"required for H.264 streams\n");
return AVERROR_BSF_NOT_FOUND;
}
ret = av_bsf_alloc(filter, &bsf);
if (ret < 0)
return ret;
cs->bsf = bsf;
ret = avcodec_parameters_copy(bsf->par_in, st->codecpar);
if (ret < 0)
return ret;
ret = av_bsf_init(bsf);
if (ret < 0)
return ret;
本文來自博客園,作者:faithlocus,轉載請注明原文鏈接:https://www.cnblogs.com/faithlocus/p/15570315.html
總結
以上是生活随笔為你收集整理的annexb avcc的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Fortify漏洞之Insecure R
- 下一篇: UOS桌面专业版:修改应用图标和应用名称