#define inline _inline#ifndef INT64_C#define INT64_C(c) (c ## LL)#define UINT64_C(c) (c ## ULL)#endif#ifdef __cplusplusextern "C" {#endif#include <libavformat/avformat.h>#include <libavcodec/avcodec.h>#include <libswscale/swscale.h>#ifdef __cplusplus}#endif#include <stdio.h>static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame);int main (int argc, const char * argv[]){char* filename = "E:\\A.mp4";AVFormatContext *pFormatCtx = NULL;int i, videoStream;AVCodecContext *pCodecCtx;AVCodec *pCodec;AVFrame *pFrame;AVFrame *pFrameRGB;AVPacket packet;int frameFinished;int numBytes;uint8_t *buffer;// Register all formats and codecsav_register_all();// Open video file//if(avformat_open_input(&pFormatCtx, argv[1], NULL, NULL)!=0)if(avformat_open_input(&pFormatCtx, filename, NULL, NULL)!=0)return -1; // Couldn't open file// Retrieve stream informationif(av_find_stream_info(pFormatCtx)<0)return -1; // Couldn't find stream information// Dump information about file onto standard errorav_dump_format(pFormatCtx, 0, filename, false);return 0;}
1 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
用 avformat_find_stream_info 代替,由于ffmpeg 版本不同,新版本的会把老版本的一些函数摒弃或者删除掉。一般都有替代函数可选。
- 1 回答
- 0 关注
- 138 浏览
添加回答
举报
0/150
提交
取消