- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据Need to convert h264 stream from annex-b format to AVCC format :
AnnexB format:
([start code] NALU) | ( [start code] NALU) |
AVCC format:
([extradata]) | ([length] NALU) | ([length] NALU) |
目前,您可以使用
av_parser_parse2 解析比特流(AnnexB 格式)然后将此缓冲区传递给
avcodec_send_frame
,但是 AVCC 格式呢?有解析器吗?
最佳答案
是的,这是可能的。
您需要传递 avcC
的内容框至AVCodecContext::extradata解码器将对其进行解析,以获得解码所需的 PPS 和 SPS NALU。
这是一个如何做到这一点的例子:
// `avcC` box retrieved from an MP4
char avcC[] = "...";
// Create codec parameters and copy the avcC box as extradata
codec_params = avcodec_parameters_alloc();
memcpy(codec_params.extradata, &avcC, sizeof(avcC));
codec_params.extradata_size = sizeof(avcC);
// Create the codec context and initialize it with codec parameters
codec_context = avcodec_alloc_context3();
avcodec_parameters_to_context(codec_context, codec_params);
// Create the codec and initialize it
codec = avcodec_find_decoder(AV_CODEC_ID_H264);
avcodec_open2(codec_context, codec, NULL);
avcC
框,位于 MP4 框层次结构中的以下路径:
moov > trak > mdia > minf > stbl > stsd > avc1 > avcC
关于ffmpeg 可以解析/解码 AVCC 格式的数据包吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68877677/
根据Need to convert h264 stream from annex-b format to AVCC format : AnnexB format: ([start code] NALU
我正在尝试使用 C++ 中的 FFMPEG API 将原始 H264 编码为 mp4 容器。一切正常,但 AVCC 框为空,并返回错误:[iso 文件] 框“avcC”大小 8 无效 如果我然后在输出
我正在研究视频文件的来源识别,尤其是那些来自智能手机 s。 我知道 .mp4 视频文件中的 avcC 框中的值具有解码器在处理编码流时必须知道的编码选项(h.264)。 而且我猜大多数智能手机都使用定
我正在使用 AVAssetWriter/AVAssetWriterInput 将 H.264 原始数据写入 MP4 文件。当我从远程服务器接收数据时,我使用以下 CoreMedia API 获取样本缓
当使用 java 的 mp4parser 库读取源自 iTunes 的文件时,有没有办法访问 avcC 原子?我在一些自定义代码中使用 paspatom 手动完成了此操作,但切换到该库后我失去了对数据
我创建了一个 java 程序来解析 mp4 和 ts 段。我将带有 ffmpeg 的 ts 片段混合到 mp4 中。我试图理解为什么 ffmpeg 以这种方式形成 mdat。 以下是从 TS-PES
我尝试将 Android 相机预览帧编码为 h264,并复用到 mp4 容器。 我可以成功创建 mp4 文件。但是 mp4 格式似乎已损坏。 使用ffprobe,我得到了以下错误。 $ ffprobe
您好试图找到传递给 FFMPEG 的命令行参数,以将 ANNEX B 格式的原始 H.264 文件转换为 AVCC 格式,但我在互联网上找不到任何东西。我只找到了相反的内容(AVCC 到 ANNEX
我有一个 H.264/AVC NAL 流,由类型 1(P 帧)、5(I 帧)、7(SPS)和 8(PPS)组成。我想将它们写入 .mov 文件而不重新编码。我正在尝试使用 AVAssetWriter
我是一名优秀的程序员,十分优秀!