国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

自己做靜態(tài)網(wǎng)站的步驟百度搜索技巧

自己做靜態(tài)網(wǎng)站的步驟,百度搜索技巧,wordpress右邊微信,懷化公積金網(wǎng)站前言 參考了雷神的自制播放器項(xiàng)目,100行代碼實(shí)現(xiàn)最簡(jiǎn)單的基于FFMPEGSDL的視頻播放器(SDL1.x) 不過老版本的代碼參考意義不大了,我現(xiàn)在準(zhǔn)備使用Qt VS2022 FFmpeg59重寫這部分代碼,具體的代碼倉庫如下: …

前言

參考了雷神的自制播放器項(xiàng)目,100行代碼實(shí)現(xiàn)最簡(jiǎn)單的基于FFMPEG+SDL的視頻播放器(SDL1.x)

不過老版本的代碼參考意義不大了,我現(xiàn)在準(zhǔn)備使用Qt + VS2022 + FFmpeg59重寫這部分代碼,具體的代碼倉庫如下:

LeventureQys/MediaPlay-FFmpeg

開發(fā)環(huán)境:
Visual Studio 2022 + Qt 5.14.2 + FFmpeg 59

本文任務(wù)

  1. 調(diào)通編譯環(huán)境
  2. 打印協(xié)議支持信息、AVFormat信息、AVCodec 支持信息、AVFilter信息、配置信息等
  3. 提供一個(gè)通用的調(diào)試框架

流程

1. 開發(fā)環(huán)境準(zhǔn)備

首先我們Visual Studio 2022 + qt是準(zhǔn)備好的,這里不做過多介紹了。
這里簡(jiǎn)單說說我在做這一塊的時(shí)候,為什么沒有選擇用雷神已經(jīng)寫好的代碼和庫來進(jìn)行開發(fā),因?yàn)槔习鎓fmpeg對(duì)新的項(xiàng)目支持比較差,而且是32位的,不兼容64位的qt,而且老版本的c++兼容對(duì)新版的編譯器有很多問題,所以我在多次嘗試沒法正常使用VS 2022 + qt完成雷神的代碼編譯之后就放棄了,準(zhǔn)備用新版的ffmpeg來進(jìn)行一些編寫,而且實(shí)際上新版的接口更合理,不過有一些改動(dòng),需要稍微查一下。總的來說流程是一回事。

下載FFmpeg的build : FFmpeg-Builds - Public

壓縮包里的內(nèi)容如下:
在這里插入圖片描述
其中include是頭文件,lib是鏈接文件,bin是dll文件

具體鏈接和include這里就不談了,很簡(jiǎn)單,隨便配配就行了

2. 具體代碼

在導(dǎo)入頭文件的時(shí)候,需要注意是以這種形式導(dǎo)入:

下面的#pragma comment (lib, “”) 是選配的,你可以在代碼中寫,也可以在工程中預(yù)備配置好

需要注意的是,新版本的迭代器和老版本的不太一樣,現(xiàn)在這個(gè)是自制了一個(gè)void*類型來作為迭代器使用的,所以需要注意!

//Windows
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavfilter/avfilter.h"
};extern "C"
{
#pragma comment (lib, "Ws2_32.lib")  
#pragma comment (lib, "avcodec.lib")
#pragma comment (lib, "avdevice.lib")
#pragma comment (lib, "avfilter.lib")
#pragma comment (lib, "avformat.lib")
#pragma comment (lib, "avutil.lib")
#pragma comment (lib, "swresample.lib")
#pragma comment (lib, "swscale.lib")
};

我這里做了一個(gè)BaseInfos類,內(nèi)容就是返回這幾個(gè)特定信息的QString內(nèi)容,如下:

BaseInfo.h

#pragma once#include <QObject>
/// <summary>
/// 這個(gè)類用于獲得所有的ffmpeg信息
/// </summary>
/// 
#include "PublicHeader.h"
//FIX
struct URLProtocol;class BaseInfos : public QObject
{Q_OBJECTpublic:BaseInfos(QObject* parent = nullptr);/// <summary>/// 協(xié)議支持信息/// </summary>/// <returns>輸入內(nèi)容和輸出內(nèi)容</returns>QString getProtocolInfo();/// <summary>/// 獲得AVFormat信息/// </summary>/// <returns></returns>QString getAVFormatInfo();/// <summary>/// 獲得AVCodec 支持信息/// </summary>/// <returns></returns>QString getAVCodedInfo();/// <summary>/// 獲得AVFilter信息/// </summary>/// <returns></returns>QString getAVFilterInfo();/// <summary>/// 獲得配置信息/// </summary>/// <returns></returns>QString getConfigurationInfo();                  ~BaseInfos();
};

BaseInfos.cpp

#include "BaseInfos.h"BaseInfos::BaseInfos(QObject* parent): QObject(parent)
{}QString BaseInfos::getProtocolInfo()
{//初始化一個(gè)info字符串char info[10000] = { 0 };avformat_network_init();struct URLProtocol* pup = nullptr;//inputstruct URLProtocol** p_temp = &pup;avio_enum_protocols((void**)p_temp, 0);while ((*p_temp) != nullptr) {sprintf(info, "%s[ProtocolInfo - In ][%10s]\n", info, avio_enum_protocols((void**)p_temp, 0));}pup = nullptr;//outputavio_enum_protocols((void**)p_temp, 1);while ((*p_temp) != nullptr) {sprintf(info, "%s[ProtocolInfo - Out][%10s]\n", info, avio_enum_protocols((void**)p_temp, 1));}QString ret = QString::fromUtf8(info, 10000);return ret;
}QString BaseInfos::getAVFormatInfo()
{// 初始化一個(gè)info字符串char info[10000] = { 0 };avformat_network_init();const AVInputFormat* input_format = nullptr;const AVOutputFormat* output_format = nullptr;// 輸入while ((input_format = av_demuxer_iterate((void**)&input_format)) != nullptr) {sprintf(info, "%s[getAVFormatInfo - In ] %10s\n", info, input_format->name);}// 輸出while ((output_format = av_muxer_iterate((void**)&output_format)) != nullptr) {sprintf(info, "%s[getAVFormatInfo- Out] %10s\n", info, output_format->name);}QString ret = QString::fromUtf8(info, 10000);return ret;}QString BaseInfos::getAVCodedInfo()
{char info[50000] = { 0 };avformat_network_init();const AVCodec* codec_temp = nullptr;void* opaque = nullptr;codec_temp = av_codec_iterate(&opaque);while ((codec_temp = av_codec_iterate(&opaque)) != nullptr) {const AVCodec* decoder = avcodec_find_decoder(codec_temp->id);if (decoder != nullptr) {sprintf(info, "%s[getAVCodedInfo -Dec]", info);}else {sprintf(info, "%s[getAVCodedInfo - Enc]", info);}switch (codec_temp->type) {case AVMEDIA_TYPE_VIDEO: {sprintf(info, "%s[getAVCodedInfo - Video]", info);break;}case AVMEDIA_TYPE_AUDIO: {sprintf(info, "%s[getAVCodedInfo - Audio]", info);break;}default: {sprintf(info, "%s[getAVCodedInfo - Other]", info);break;}}}return QString::fromUtf8(info,50000);}QString BaseInfos::getAVFilterInfo()
{char info[10000] = { 0 };avformat_network_init();const AVFilter* filter = nullptr;void* opaque = nullptr;filter = av_filter_iterate(&opaque);while ((filter = av_filter_iterate(&opaque)) != nullptr) {sprintf(info, "%s[%10s]\n", info, filter->name);}QString ret = QString::fromUtf8(info);return ret;
}QString BaseInfos::getConfigurationInfo()
{char info[10000] = { 0 };avformat_network_init();sprintf(info, "%s\n", avcodec_configuration());return QString::fromUtf8(info);
}BaseInfos::~BaseInfos()
{}

3.效果

在這里插入圖片描述

http://aloenet.com.cn/news/38218.html

相關(guān)文章:

  • 建站寶盒做的網(wǎng)站十大免費(fèi)excel網(wǎng)站
  • 公司做網(wǎng)站之前要準(zhǔn)備什么軟件廣點(diǎn)通廣告投放平臺(tái)登錄
  • 什么網(wǎng)站做電氣自動(dòng)化兼職做優(yōu)化的網(wǎng)站
  • 做博物館網(wǎng)站最重要性seo視頻教學(xué)網(wǎng)站
  • 深圳做網(wǎng)站有哪些指數(shù)函數(shù)
  • 設(shè)計(jì)師做網(wǎng)站的流程西安網(wǎng)站建設(shè)哪家好
  • 怎么設(shè)計(jì)自己的網(wǎng)站知乎小說推廣對(duì)接平臺(tái)
  • 專業(yè)汽車網(wǎng)站seo日常工作都做什么的
  • 做網(wǎng)站百度推廣多少錢客戶關(guān)系管理系統(tǒng)
  • 設(shè)計(jì)做網(wǎng)站哪家公司好短期培訓(xùn)班學(xué)什么好
  • 遼寧城鄉(xiāng)建設(shè)部網(wǎng)站首頁網(wǎng)站策劃是干什么的
  • 內(nèi)網(wǎng)小網(wǎng)站的建設(shè)廣州網(wǎng)站運(yùn)營(yíng)
  • 仿站能被百度收錄嗎招商外包
  • 主流網(wǎng)站開發(fā)軟件優(yōu)秀網(wǎng)站
  • 做二手車有哪些網(wǎng)站有哪些競(jìng)價(jià)推廣代運(yùn)營(yíng)
  • 本地網(wǎng)站建設(shè)多少錢信息大全百度推廣怎么開戶
  • 素材下載網(wǎng)站源碼seo網(wǎng)絡(luò)推廣企業(yè)
  • 上海微網(wǎng)站公司實(shí)時(shí)熱搜
  • 北京市環(huán)境建設(shè)辦公室網(wǎng)站免費(fèi)關(guān)鍵詞排名優(yōu)化軟件
  • 網(wǎng)站備案?jìng)涞氖怯蛎€是空間企業(yè)培訓(xùn)有哪些方面
  • 深圳做網(wǎng)站哪家便宜微信小程序開發(fā)公司
  • 滄州wap網(wǎng)站制作企業(yè)推廣網(wǎng)
  • 小程序網(wǎng)站開發(fā)怎么樣谷歌廣告上海有限公司
  • 做外貿(mào)怎么打開國(guó)外網(wǎng)站亞馬遜關(guān)鍵詞搜索工具
  • 想自己做點(diǎn)飄紗素材到網(wǎng)站上買鄭州seo服務(wù)技術(shù)
  • 網(wǎng)站自助授權(quán)系統(tǒng)站長(zhǎng)之家網(wǎng)站排名
  • 成立一個(gè)網(wǎng)站平臺(tái)要多少錢關(guān)鍵詞是怎么排名的
  • 品牌網(wǎng)站建設(shè)小科6a蚪湖北網(wǎng)絡(luò)推廣有限公司
  • 做網(wǎng)站要注意哪些長(zhǎng)春網(wǎng)絡(luò)優(yōu)化最好的公司
  • 網(wǎng)站建設(shè)需要多大的空間百度數(shù)據(jù)庫