gpt4 book ai didi

c++ - av_read_frame 是否添加 FF_INPUT_BUFFER_PADDING_SIZE?

转载 作者:行者123 更新时间:2023-11-30 02:38:03 26 4
gpt4 key购买 nike

我正在使用 libav 读取 MPEG 流。
我正在使用函数 av_read_frame() 将一些帧读入数据包:

av_read_frame(pFormatCtx, &packet)

然后我使用函数 avcodec_decode_video2 将数据包解码为帧。
函数 avcodec_decode_video2 的文档包含以下警告:

The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end. The end of the input buffer buf should be set to 0 to ensure that no overreading happens for damaged MPEG streams.

我想知道 av_read_frame 函数是否还没有分配额外的 FF_INPUT_BUFFER_PADDING_SIZE?

谢谢。

最佳答案

是的,av_read_frame() 总是为您添加 FF_INPUT_BUFFER_PADDING_SIZE。如果您使用自己的解复用数据作为 avcodec_decode_video2() 的输入,您只需要关心这一点,例如如果您编写自己的解复用器(就像 VLC 或 mplayer 所做的那样)。

关于c++ - av_read_frame 是否添加 FF_INPUT_BUFFER_PADDING_SIZE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179811/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com