======================================================================================
ffmpeg视频H264压缩,rtsp推流课程教学视频:
https://edu.youkuaiyun.com/course/detail/27795
课件中里面提供源码可以直接下载运行!
======================================================================================
一、 创建videoplayer线程 视频读取的过程都在线程中完成
关联槽函数和信号
VideoPlayerThread = new VideoPlayer;
connect(VideoPlayerThread, SIGNAL(sig_GetOneFrame(QImage)),this,SLOT(slotGetOneFrame(QImage)));
二、完成线程读取视频的过程
1 初始化ffmpeg
av_register_all(); //初始化FFMPEG 调用了这个才能正常适用编码器和解码器
avformat_network_init(); // 初始化网络模块
//=========================== 创建AVFormatContext结构体 ===============================//
//分配一个AVFormatContext,FFMPEG所有的操作都要通过这个AVFormatContext来进行
AVFormatContext *pFormatCtx = avformat_alloc_context();
//==================================== 打开文件 ======================================//
char *file_path = "E:/QT/test_ffmpegPlayer/test_ffmpegPlayer/Wildlife.wmv ";//这里必须使用左斜杠
int ret = avformat_open_input(&pFormatCtx, file_path, NULL, NULL);
if(ret != 0)