【发布时间】:2013-08-22 15:24:56
【问题描述】:
我正在编写一个 BlackBerry 10 应用程序,它使用 ffmpeg 和 libx264 解码 H264 视频流(来自 Parrot AR Drone)。这些库都针对 BlackBerry QNX 进行了编译。
这是我的代码:
av_register_all();
avcodec_register_all();
avformat_network_init();
printf("AV setup complete\n");
const char* drone_addr = "http://192.168.1.1:5555";
AVFormatContext* pFormatCtx = NULL;
AVInputFormat* pInputFormat = av_find_input_format("H264");
printf("Opening video feed from drone\n");
//THIS LINE FAILS
int result = avformat_open_input(&pFormatCtx, drone_addr, pInputFormat, NULL);
最后一行失败并出现错误:
Malloc Check Failed: :../../dlist.c:1168
如何修复此错误或进一步调试?
更新:仅当我将pInputFormat 提供给avformat_open_input 时才会出现该错误。如果我提供 NULL 我不会收到错误。但是对于我的应用程序,我必须提供此参数,因为 ffmpeg 无法单独从提要中确定视频格式。
【问题讨论】:
-
您是否尝试使用“h264”是小型大写字母?
ffmpeg -formats列出了 h264,众所周知它比较挑剔。 -
谢谢,好主意,不幸的是我仍然遇到同样的错误。
pInputFormat不为空,所以我假设它已正确初始化。 -
好吧,我想你必须找到一种方法来从错误中获得完整的回溯。您是否有 GDB 或同等软件可供您使用?
-
我有 gdb。只是想弄清楚如何使用调试符号编译 x264 和 ffmpeg。
标签: c ffmpeg blackberry-10 x264 qnx