資源簡介
從零開始學習音視頻編程技術(41) H.264播放器
ffmpeg4.1解碼h264和h265,并使用Qt的OpenGL顯示播放的例子
這是Qt的工程,建議使用Qt Creator 打開
Qt5.6.2(vs2013/mingw) + ffmpeg4.1
1.程序可以在windows/linux下直接編譯使用。
2.windows下的庫為官網直接下載的。
3.linux下已經編譯好的庫為centos6.5(64位)(gcc 版本 4.4.7)下編譯的,如需32位的庫請自行編譯。
關于代碼的解釋 請參考:
http://blog.yundiantech.com/?log=blog&id=41
ffmpeg4.1解碼h264和h265,并使用Qt的OpenGL顯示播放的例子
這是Qt的工程,建議使用Qt Creator 打開
Qt5.6.2(vs2013/mingw) + ffmpeg4.1
1.程序可以在windows/linux下直接編譯使用。
2.windows下的庫為官網直接下載的。
3.linux下已經編譯好的庫為centos6.5(64位)(gcc 版本 4.4.7)下編譯的,如需32位的庫請自行編譯。
關于代碼的解釋 請參考:
http://blog.yundiantech.com/?log=blog&id=41
代碼片段和文件信息
#include?“AppConfig.h“
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?ject>
#include?
#include?
#include?ject>
#include?
#if?defined(WIN32)
#include?
#include?
#include?
#include??//C?(Windows)????access
#else
#include?
#include?
#include?
void?Sleep(long?mSeconds);
//{
//????usleep(mSeconds?*?1000);
//}
#endif
QString?AppConfig::APPID?=?“{a1db97ad-b8ed-11e9-a297-0235d2b38928}“;
int?AppConfig::VERSION?=?1;
QString?AppConfig::VERSION_NAME?=?“2.1.3“;
MainWindow?*AppConfig::gMainWindow?=?NULL;
QRect?AppConfig::gMainWindowRect;
QRect?AppConfig::gScreenRect;
bool?AppConfig::gVideoKeepAspectRatio?=?false;?//按比例顯示
bool?AppConfig::gVideoHardDecoder?=?false;?//硬解解碼
QString?AppConfig::gVideoFilePath;
QString?AppConfig::AppDataPath_Main;
QString?AppConfig::AppDataPath_Data;
QString?AppConfig::AppDataPath_Tmp;
QString?AppConfig::AppDataPath_TmpFile;
QString?AppConfig::AppFilePath_Log;
QString?AppConfig::AppFilePath_LogFile;
QString?AppConfig::AppFilePath_EtcFile;
AppConfig::AppConfig()
{
}
void?AppConfig::MakeDir(QString?dirName)
{
????QDir?dir;
????dir.mkpath(dirName);
}
void?AppConfig::InitAllDataPath()
{
#if?defined(WIN32)
????///windows數據存儲在C盤的數據目錄下
????QFileInfo?fileInfo(QCoreApplication::applicationFilePath());
????QString?exeFileName?=?fileInfo.baseName();?//當前程序名字
????QString?dataPath?=?QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
????if?(dataPath.right(exeFileName.length())?==?exeFileName)
????{
????????dataPath?=?dataPath.left(dataPath.length()?-?exeFileName.length());
????}
????if?(!dataPath.endsWith(“/“))
????{
????????dataPath?+=?“/“;
????}
#else
????///Linux則放在程序所在目錄下的data目錄下
????QFileInfo?fileInfo(QCoreApplication::applicationFilePath());
????QString?dataPath?=?fileInfo.absoluteDir().path();
????if?(!dataPath.endsWith(“/“))
????{
????????dataPath?+=?“/“;
????}
#endif
qDebug()<<__FUNCTION__<
????AppDataPath_Main?=?dataPath;
????AppDataPath_Data?=?AppDataPath_Main?+?“/data“;
????QString?dirName?=?AppDataPath_Data?+?“/etc“;
????MakeDir(dirName);
????AppFilePath_EtcFile?=?dirName?+?“/main.conf“;
????AppDataPath_Tmp?=?AppDataPath_Data?+?“/tmp“;
????AppFilePath_Log?=?AppDataPath_Data?+?“/log“;
????AppDataPath_TmpFile?=?AppDataPath_Tmp?+?“/tmp.txt“;
????MakeDir(AppDataPath_Data);
????MakeDir(AppFilePath_Log);
????MakeDir(AppDataPath_Tmp);
????InitLogFile();
}
QString?AppConfig::bufferToString(QByteArray?sendbuf)
{
????QString?tmp;
????for?(int?k?=?0;?k
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-11-27?11:46??VideoDecode\
?????目錄???????????0??2019-11-13?09:50??VideoDecode\bin32\
?????文件????31462912??2019-09-06?18:09??VideoDecode\bin32\avcodec-58.dll
?????文件?????1304576??2019-09-06?18:09??VideoDecode\bin32\avdevice-58.dll
?????文件?????7103488??2019-09-06?18:09??VideoDecode\bin32\avfilter-7.dll
?????文件?????5989888??2019-09-06?18:09??VideoDecode\bin32\avformat-58.dll
?????文件??????655360??2019-09-06?18:09??VideoDecode\bin32\avutil-56.dll
?????文件??????293888??2019-09-06?18:09??VideoDecode\bin32\ffmpeg.exe
?????文件??????148480??2019-09-06?18:09??VideoDecode\bin32\ffplay.exe
?????文件??????162816??2019-09-06?18:09??VideoDecode\bin32\ffprobe.exe
?????文件??????113664??2019-09-06?18:09??VideoDecode\bin32\postproc-55.dll
?????文件??????311808??2019-09-06?18:09??VideoDecode\bin32\swresample-3.dll
?????文件??????516096??2019-09-06?18:09??VideoDecode\bin32\swscale-5.dll
?????文件???????81408??2019-11-13?15:11??VideoDecode\bin32\VideoDecode.exe
?????文件?????3936256??2019-11-13?09:42??VideoDecode\bin32\VideoDecode.pdb
?????目錄???????????0??2019-11-13?10:02??VideoDecode\bin64\
?????文件????45110784??2019-09-06?18:09??VideoDecode\bin64\avcodec-58.dll
?????文件?????2423296??2019-09-06?18:09??VideoDecode\bin64\avdevice-58.dll
?????文件?????7584768??2019-09-06?18:09??VideoDecode\bin64\avfilter-7.dll
?????文件?????6357504??2019-09-06?18:09??VideoDecode\bin64\avformat-58.dll
?????文件??????658944??2019-09-06?18:09??VideoDecode\bin64\avutil-56.dll
?????文件??????292352??2019-09-06?18:09??VideoDecode\bin64\ffmpeg.exe
?????文件??????153600??2019-09-06?18:09??VideoDecode\bin64\ffplay.exe
?????文件??????168448??2019-09-06?18:09??VideoDecode\bin64\ffprobe.exe
?????文件??????122880??2019-09-06?18:09??VideoDecode\bin64\postproc-55.dll
?????文件??????424448??2019-09-06?18:09??VideoDecode\bin64\swresample-3.dll
?????文件??????540160??2019-09-06?18:09??VideoDecode\bin64\swscale-5.dll
?????文件?????2426176??2019-10-24?14:21??VideoDecode\bin64\VideoDecode
?????文件???????94208??2019-11-27?11:42??VideoDecode\bin64\VideoDecode.exe
?????文件?????3338240??2019-10-24?15:27??VideoDecode\bin64\VideoDecode.pdb
?????目錄???????????0??2019-10-24?14:25??VideoDecode\data\
............此處省略342個文件信息
- 上一篇:《計算機科學導論弗羅贊》.rar
- 下一篇:海康威視標定
評論
共有 條評論