c代码
#include <libavutil/log.h>
#include <libavformat/avformat.h>
int main(int argc ,char* argv[]){
int result ;
AVFormatContext *fmt_ctx = NULL;
av_log_set_level(AV_LOG_INFO);
av_register_all();
result = avformat_open_input(&fmt_ctx,"./test.mp4",NULL,NULL);
if(result < 0){
av_log(NULL,AV_LOG_ERROR,"can't open file : %s \n",av_err2str(result));
return -1;
}
av_dump_format(fmt_ctx,0,"./test.mp4",0);
avformat_close_input(&fmt_ctx);
return 0;
}