原MP4格式视频文件
格式转换后mov格式文件
转换成功
实现方式
//引入c语言头文件
extern "C"
{
#include <libavformat\avformat.h>
}
#include <iostream>
using namespace std;
//引入链接库
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avcodec.lib")
#pragma comment(lib,"avutil.lib")
//将MP4格式的文件转换成mov格式
int main()
{
char infile[] = "test.mp4";
char outfile[] = "test.mov";
//注册封装,解封装格式
av_register_all();
//1 打开文件
AVFormatContext *ic = NULL;
avformat_open_input(&ic,infile,0,0);
if (!ic) {
cout << &