关于ffmpeg接口调用崩溃的问题
各位大家好
今天看了一个ffmpeg的例子,然后再网上下了一个libav的库。据说现在libav和ffmpeg基本相同。看代码也差不多。用MinGW-MSYS工具在windows下面编一个libav库(这个是在libav官网上下载的最新的)
具体代码:
const char* input = "D:\\MYWorkspace\\libavTots\\tsconverter\\Release\\test1.264";
AVInputFormat* ifmt = NULL;
AVOutputFormat* ofmt = NULL;
AVFormatContext* ic = NULL;
AVFormatContext* oc = NULL;
av_register_all();
avcodec_register_all();
char szError[256] = {0};
int nRet = avformat_open_input(&ic, input, ifmt, NULL);
if (nRet != 0)
{
av_strerror(nRet, szError, 256);
printf(szError);
printf("\n");
printf("Call avformat_open_input function failed!\n");
return 0;
}
if (avformat_find_stream_info(ic,NULL) < 0)
{
printf("Call av_find_stream_info function failed!\n");
return 0;
}
第一个函数avformat_open_input调用返回值0 成功,到第二个就崩溃了。不知是我版本的问题还是什么原因
求知道的给解释一下 谢谢