主要过程和ffmpeg实现视频播放的过程差不多
可以参考:https://blog.csdn.net/yunge812/article/details/79342089
主要改动原始文件的读取
播放器是播放本地文件 而我们这里需要读取的是RTSP中H264数据流
char filepath[1024] = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov";
if (avformat_open_input(&pFormatCtx, filepath, NULL, NULL) != 0)
{
qDebug()<<"Couldn't open input stream";
return;
}
这里的rtsp地址是网络上用于测试的地址
之后的过程和实现播放器的过程完全一致 可以直接用来移植
效果:
源码下载地址:
https://download.csdn.net/download/yunge812/1031055098
更多详细解析以及源码可以参考本人csdn博客,里面有详细的解释
https://blog.csdn.net/yunge812