打开本地文件
观看b站太子哥视频学习记录:https://www.bilibili.com/video/BV1bT4y1w78z?p=5
代码
#include <stdio.h>
extern "C"
{
#include <libavcodec\avcodec.h>
#include <libavformat\avformat.h>
#include <libavutil\opt.h>
}
#pragma comment(lib,"avcodec.lib")
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")
int main()
{
//打开本地文件
printf("%s\n", avcodec_configuration());av_register_all();
AVFormatContext* pFormat = NULL; //设备上下文
const char* path = "11.mp4";//打开文件
int ret = avformat_open_input(&pFormat, path, NULL, NULL);
if (ret) //非0失败
{
printf("avfo