我目前正在开发一个使用ffmepg解码接收到的帧的项目,解码后,我想将AVFrame转换为opencvMat帧,以便我可以在imShow函数上播放它。我有的是字节流,我将它读入缓冲区,解码为AVFrame:f=fopen(filename,"rb");if(!f){fprintf(stderr,"Couldnotopen%s\n",filename);exit(1);}frame=avcodec_alloc_frame();if(!frame){fprintf(stderr,"Couldnotallocatevideoframe\n");exit(1);}framergb=avcode