sách gpt4 ai đã đi

无法 avformat_open_input .mp3

In lại 作者:太空宇宙 更新时间:2023-11-04 03:08:54 31 4
mua khóa gpt4 Nike

我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出:

Error code: -1094995529
Invalid data found when processing input

Còn hơn là

Error code: -2
No such file or directory

当我没有指定正确的文件名时。

在查看此错误代码的含义后,我假设我的 mp3 文件在其 header 中一定缺少 avformat_open_input() 需要识别其扩展名的信息。

我试过打开不同的 mp3 文件,甚至不同的格式。但我仍然遇到同样的错误。

这是我的主要内容

const char *url = NULL;
AVFormatContext *s = NULL;
int ret = 0;
if (ac == 2)
url = av[1];
khác
return (1);
ret = avformat_open_input(&s, url, NULL, NULL);
if (ret < 0)
{
check_error(ret);
abort();
}

知道我做错了什么吗?

Cảm ơn

1 Câu trả lời

您需要先avformat_alloc_context().

同时检查 the example code在文档中。

关于无法 avformat_open_input .mp3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58581552/

31 4 0
Bài viết được đề xuất: C Socket服务器编程发送文件
Bài viết được đề xuất: c - 为什么 srand 创建相同的数字?
Bài viết được đề xuất: c - 如何将内存分配给结构数组中的 typedef 结构
Bài viết được đề xuất: c - ARM PMU 周期计数器的值不一致
太空宇宙
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com