FFmpeg 移植问题avformat_open_input打开本地视频文件失败 急!急!急!急!急!急!急!急!

oKangKang1234567 2013-07-15 09:48:28

移植FFMPEG(嵌入式HI3516高清解码板),用avformat_open_input打开本地文件失败,avformat_open_input的返回值是-5,报错为:Input/output error。跟踪进函数源代码,发现init_input这个函数返回错误,返回值是-5,再进一步跟踪,发现avio_read(pb, buf + buf_offset, probe_size - buf_offset)返回值是-5,再进一步跟踪,发现fill_buffer(s)返回-5,不知道怎么回事,好几天都调不出来,请高手帮帮忙!给跪!!!!!!!!!!!!!!!
const char * filename="1.mov";
char szError[256] = {0};
kz_FormatContext=NULL;
//avcodec_init();
av_register_all();

kz_FormatContext = avformat_alloc_context();
int nret=avformat_open_input(&kz_FormatContext, filename, NULL, NULL);
int nret=av_open_input_stream(&kz_FormatContext,pb,filename,piFmt,NULL);
//piFmt/nfsroot/1.rmvb&kz_FormatContext
//kz_FormatContext->pb = pb;//av_open_input_file avformat_open_input, NULL
if (nret!= 0)
{//av_open_input_file
av_strerror(nret, szError, 256);
printf(szError);
printf("\n");
printf("%d\n",nret);
printf("Call avformat_open_input function failed!\n");
//return 0;
// fprintf(stderr, "avformat open failed.\n");
//AVFrame
//handle_error();
return -1;
} else {
printf( "open stream success!\n");
}
...全文
736 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
YUKUILONGQQ 2013-08-29
  • 打赏
  • 举报
回复
楼主 解决了吗 ?和你一样的问题

23,223

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧