gpt4 book ai didi

ffmpeg - 使用 avcodec_open2 和 libopus 的无效选项错误

转载 作者:行者123 更新时间:2023-12-04 23:15:20 28 4
gpt4 key购买 nike

我从 avcodec_open2 得到一个无效的选项结果在带有 libopus 1.1.4 的 ffmpeg 3.1.6 中。我已对所有选项进行了排序,但找不到有问题的选项 I created a gist holding the relevant native code .我已经搜索了有关互联网的所有信息,但到目前为止还找不到任何有用的信息。我也尝试过使用和不使用 opts 字典。

results = avcodec_open2(context, codec, &opts);
results = avcodec_open2(context, codec, 0);
所有测试和变体返回 -22 (要点第 51 行)

最佳答案

memset(context, 0, sizeof(context));



该代码需要删除。它基本上会破坏一切。具体来说,它将取消设置 avcodec_alloc_context3() 中设置的所有内容。基于 codec参数,以及更普遍的所有与编解码器无关的默认值。

(请注意,它仅将前 8 个(在 x86-64 上)字节归零,因为您使用了 sizeof(context) 而不是 sizeof(*context) )。

关于ffmpeg - 使用 avcodec_open2 和 libopus 的无效选项错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43903950/

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