工作原理读取元数据AVFormatContext结构中有一个属性是元数据,当我们读取一个多媒体文件时,我们可以通过AVDictionaryEntry访问这个属性的数据。AVFormatContext*fmt_ctx=NULL;AVDictionaryEntry*tag=NULL;av_register_all();if((ret=avformat_open_input(&fmt_ctx,"path_to_file.mp3",NULL,NULL))){printf("打开文件失败");}//读取元数据中的所有标签while((tag=av_dict_get(fmt_ctx->metadata,"",tag,AV_DICT_IGNORE_SUFFIX))){printf("Tag:%s,Value:%s",tag->key,tag->价值);}AvFormatContextAVDictionaryEntry读取元数据官方示例Readalbumcoverimage//读取格式头if(fmt_ctx->iformat->read_header(fmt_ctx)<0){printf("Noheaderformat");返回;}for(inti=0;i
