本文主要是下面这个连接的补充http://www.javashuo.com/article/p-wsapsfzc-gn.htmlide
avdevice_register_all (); avformat_network_init (); av_register_all (); AVFormatContext * pFormatCtx = avformat_alloc_context (); AVInputFormat *ifmt = av_find_input_format ( "dshow" ); av_register_input_format ( ifmt ); // 惟一区别,在我使用的3.3版本中,不加此句会获取失败 if (avformat_open_input ( &pFormatCtx, "video=Integrated Camera", ifmt, NULL ) != 0) { printf ( "Couldn't open input stream.\n" ); return -1; }
2. main函数进不去的解决办法: 在此过程当中,碰到了include "SDL.h" 就会进不去main函数的问题,解决办法是在main函数以前加上#undef main
。发生这种状况的缘由是由于sdl这个lib中定义了main,而咱们通常都是先声明头文件,这样编译器在寻找main的过程当中,就会先在sdl中发现main这个关键字,最终就致使了每次咱们启动程序,入口点就变成sdl定义的main函数。函数
欢迎在下方留言探讨.net