av_register_all();
avdevice_register_all();
const char* filename = "/dev/video0";
AVInputFormat *inputFmt = av_find_input_format ("video4linux2");
if( (ret = avformat_open_input(&format_ctx, filename, inputFmt, NULL)) < 0 )
{
av_strerror(ret, err_msg, sizeof(err_msg) );
printf("Cann't open the file: %s\n", err_msg);
return -1;
}
使用avformat_open_input(&format_ctx, filename, inputFmt, NULL)方法打开摄像头的时候出错了,错误信息是:Cann't open the file: Not a typewriter
请问这是什么原因造成的?
在线等!