当前位置: 首页 > news >正文

音箱厂家东莞网站建设怎么建立信息网站平台

音箱厂家东莞网站建设,怎么建立信息网站平台,建设个读书网站大约需要投入多少钱,绍兴公司做网站建立在上一步,vs已经能够正常调试qt项目,可以实现: 1:qt可以使用mvsc (使用cdb)进行调试。 2:vs已经可以加载qt项目,借助vs进行调试。 本文目标:编译ffmpeg库&#xf…

建立在上一步,vs已经能够正常调试qt项目,可以实现:

1:qt可以使用mvsc (使用cdb)进行调试。

2:vs已经可以加载qt项目,借助vs进行调试。

本文目标:编译ffmpeg库,编译出对应的相关库,使用qt,vs进行调试demo,为研究源码做准备。

windows安装ffmpeg以前整理过们可以参考:音视频windows环境ffmpeg搭建_

本文编译ffmpeg6.0,使调试源码环境能正常进行。

技巧:which.exe cl.exe 可以查看当前生效的执行文件

1:安装MSYS2(提供相关指令类似linux操作系统进行编译,可能windows使用)

参考:使用MSYS的一些经验 - 知乎 (zhihu.com)

可以官网下载:https://www.msys2.org/

建议通过阿⾥云的链接更快速下载:https://mirrors.aliyun.com/msys2/distrib/x86_64/msys2-x86_64-20230318.exe。

2:修改MSYS2的配置和源

安装目录下(D:\software\msys2)msys2_shell.cmd 文件进行修改:

#inherit 代表把当前窗口的环境变量导入给 msys2 的命令行。    把vs窗口继承给msys2
#修改源文件中rem set MSYS2_PATH_TYPE=inherit 为:
set MSYS2_PATH_TYPE=inherit

修改对应文件下的源,在文件开头增加:

#D:\software\msys2\etc\pacman.d\mirrorlist.mingw32 中
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/#D:\software\msys2\etc\pacman.d\mirrorlist.mingw64  中
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/#D:\software\msys2\etc\pacman.d\mirrorlist.msys  中
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch/
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/

修改验证方式:

# 在D:\software\msys2\etcpacman.conf中
#大概40行位置   作用是修改源后,屏蔽签名SigLevel = Never
#SigLevel    = Required
#LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

3:使用msys2安装基础组件

1:这里要基于vs2019进行调试,所以编译时基于vs2019启动msys2.

===》在启动项中visual studio 2019 目录下,以管理员身份启动命令行窗口(x64 Native Tools Command Prompt for VS 2019 )

-----------》用vs启动msys2,加上上面配置过,则msys2继承vs2019的环境变量了。

===》跳转到对应msys2安装目录下,启动

D:\software\msys2>doskey /HISTORY
D:
cd  msys2
msys2_shell.cmd -mingw64   #启动对应指令#如果要打开msys2的msys窗⼝
#msys2_shell.cmd

===》启动对应的msys2窗口,只想相关的安装指令:

#刷新软件包数据
pacman -Sy
#安装编译环境:pacman -S mingw-w64-x86_64-toolchainpacman -S gitpacman -S makepacman -S automakepacman -S autoconfpacman -S perlpacman -S libtoolpacman -S mingw-w64-x86_64-cmake    #注意这里安装的是x64的cmakepacman -S pkg-configpacman -S mingw-w64-x86_64-SDL2     #安装SDL 这里是mingw 使用时支持 vs要支持需要安装vc版,下面安装
#安装一些编译需要依赖的库  pacman -S yasmpacman -S nasm

===》修改msys2窗口支持中文显示:

窗⼝右键->Options->Text,然后locale选择:zh_CN,Character set 选择 UTF-8。

4:用msys2源码编译安装第三方库。

1:libx264

要求编译ffmpeg时配置:–enable-gpl --enable-libx264.

cd ~
mkdir ffmpeg6.0_sources
cd ffmpeg6.0_sources/
git clone --depth 1 https://github.com/mirror/x264.git
cd x264/
CC=cl ./configure --enable-shared
make
make install
cp /usr/local/lib/libx264.dll.lib /usr/local/lib/libx264.lib#需要有/usr/local/lib/pkgconfig/x264.pc 文件 改成:
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/includeName: x264
Description: H.264 (MPEG4 AVC) encoder library
Version: 0.164.x
Libs: -L${exec_prefix}/lib -lx264 
Libs.private: 
Cflags: -I${prefix}/include -DX264_API_IMPORTS

2:libx265

要求编译ffmpeg时配置:–enable-gpl --enable-libx265.

#libx265编译比较特殊 编译脚本文件是vs调用makefile文件,并且要用nmake进行编译
#注释掉 msys2本身的cmake
mv /mingw64/bin/cmake.exe /mingw64/bin/ccmake.exe
#进行编译
cd ffmpeg6.0_sources/
git clone https://gitee.com/mirrors_videolan/x265.git
cd x265/build/msys-cl/
#进行编译
./make-Makefiles.sh#拷贝相关目标文件 及配置
cp x265.exe libx265.dll /usr/local/bin/
cp libx265.lib /usr/local/lib/x265.lib
cp x265-static.lib /usr/local/lib/
cp x265_config.h /usr/local/include/
cp ../../source/x265.h /usr/local/include/
cp x265.pc /usr/local/lib/pkgconfig/#需要修改/usr/local/lib/pkgconfig/x265.pc 文件 改成:
prefix=/usr/local

3:libfdk-aac

要求编译ffmpeg时配置:–enable-libfdk-aac ( 如果你已经配置了 --enable-gpl则需要加上-- enable-nonfree).

cd  ffmpeg6.0_sources/
#下载网络问题 就多试几次
git clone https://github.com/mstorsjo/fdk-aac.git fdk-aac-2.0.1
cd fdk-aac-2.0.1/
git checkout v2.0.1
#注释掉msys2的link 要用vs2019的link
mv /usr/bin/link.exe /usr/bin/link-bk.exe
which.exe link  #可以多看看
#编译和安装
nmake -f Makefile.vc all
nmake -f Makefile.vc prefix=/usr/local install
#恢复link
mv /usr/bin/link-bk.exe /usr/bin/link.exe#需要新增 /usr/local/lib/pkgconfig/fdk-aac.pc 文件 增加
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Fraunhofer FDK AAC Codec Library
Description: AAC codec library
Version: 2.0.1
Libs: -L${libdir} -lfdk-aac
Libs.private:
Cflags: -I${includedir}

4:安装SDL2(msvc支持,需要安装vc版本)

ffmpeg需要配置支持: --enable-sdl2

安装路径:Release 2.26.5 · libsdl-org/SDL · GitHub

下载对应的包:SDL2-devel-2.26.5-VC.zip

#下载后解压对应的包后。 拷贝头文件和lib文件
#把SDL2目录下的include目录 拷贝到msys2安装目录下 \usr\local\include目录下,并把文件夹改为SDL2
#把SDL2目录下的lib/x64下相关lib拷贝到 \usr\local\lib目录下#需要配置sdl2的环境变量,使sdl2可以被系统识别到
export INCLUDE=$INCLUDE";D:\software\msys2\usr\local\include\SDL2"
export LIB=$LIB";D:\software\msys2\usr\local\lib"
#查看
echo $LIB#同样需要配置/usr/local/lib/pkgconfig/sdl2.pc 编辑如下:
prefix==/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: sdl2
Description: Simple DirectMedia Layer is a cross-platform multimedia libra
ry designed to provide low level access to audio, keyboard, mouse, joystic
k, 3D hardware via OpenGL, and 2D video framebuffer.
Version: 2.26.5
Requires:
Conflicts:
Libs: -L${libdir} -lSDL2main -lSDL2
Cflags: -I${includedir}

在这里插入图片描述

拷贝lib参考:
在这里插入图片描述

5:源码安装ffmpeg6.0 (6.0还有一些报错,日志相关,先屏蔽后)

cd ffmpeg6.0_sources/
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg/
git checkout remotes/origin/release/6.0
cd ../
cp -arf FFmpeg ffmpeg6.0
cd ffmpeg6.0/
CC=cl.exe PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure --toolchain=msvc --enable-shared --enable-ffplay --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-sdl2 --enable-gpl --enable-nonfree --disable-optimizations --disable-stripping
mv /usr/bin/link.exe /usr/bin/link.exe.bk
which link  #这里直接用vs的link编译了
make -j24   #这里编译有报错,日志相关的直接注释掉就好,暂不关注  但是测试时日志显示不全#这里还有一个编码的警告  c4828,应该需要修改编码格式,但是暂时没处理
make install#进行测试:
ffplay.exe http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
ffplay.exe http://mirror.aarnet.edu.au/pub/TED-talks/911Mothers_2010W-480p.mp4

5:qt项目进行调试

ffmpeg以及相关依赖都已经安装成功,使用qt调用进行调试。

===》这里目的时可以debug ffmpeg api内部源码,用vs2019+qt插件+MSCV。

===》qt+mingGw 无法调试ffmpeg api内部源码

===》建立在上述ffmpeg编译时,没有进行编译优化。

1:使用qt新建一个项目(c/c++)

c项目:

#include <stdio.h>
#include "libavutil/avutil.h"
int main()
{printf("hello ffmpeg version is: %s \n",av_version_info());return 0;
}

c++项目注意,头文件的包含

#include <iostraem>
// 包含ffmpeg头⽂件
#ifdef __cplusplus //⽽这⼀部分就是告诉编译器,如果定义了__cplusplus(即如果是cpp⽂件,
extern "C"{
#include "libavutil/avutil.h"
#endif
#ifdef __cplusplus
}
#endif
int main()
{ 
std::cout << Hello FFMPEG, version is " << av_version_info() << std::end
l; 
return 0;
}

注意在对应的.pro文件中增加头文件和lib文件识别:

#win32代表了是windows上执行   $$PWD代表项目目录本身。
win32 {
INCLUDEPATH += $$PWD/ffmpeg6.0\include
LIBS += $$PWD/ffmpeg6.0/lib/avformat.lib \$$PWD/ffmpeg6.0/lib/avcodec.lib \$$PWD/ffmpeg6.0/lib/avdevice.lib \$$PWD/ffmpeg6.0/lib/avfilter.lib \$$PWD/ffmpeg6.0/lib/avutil.lib \$$PWD/ffmpeg6.0/lib/postproc.lib \$$PWD/ffmpeg6.0/lib/swresample.lib \$$PWD/ffmpeg6.0/lib/swscale.lib
}

====》拷贝对应的头文件和lib到对应目录下(这里应该可以配置成死目录):

这里直接拷贝msys2目录下 /usr下的local目录到项目目录,然后修改文件夹local为ffmpeg6.0

=====》编译时报找不到对应的lib

对目录进行修改:把目录下bin目录中对应avformat.lib等lib文件拷贝到lib目录下

=====》进行编译,报错The CDB process terminated,在相关的环境都安装正常场景下,该问题是运行第三方库的问题。

拷贝对应的dll文件到构建后生成的项目文件夹下,再次调试ok。

2:使用vs加载qt项目进行尝试。

启动vs2019并不加载项目,在**扩展---->QT VS Tools–>Open Qt Project(.pro)**加载qt项目。

加载完成后,会在对应的qt项目下生成相关vs的项目文件,以vcxproj结尾。

用vs2019加载vcxproj项目文件,即可以在vs2019中调试我们的项目。

总结:

1:调试环境搭建比较繁琐,需要注意细节,第一个demo调试程序要运行ok。

2:使用msys2进行ffmpeg源码,需要注意相关库的编译,pkgconfig中配置,编译时用到的cmake,link,以及最终生成的lb,头文件,以及可执行文件目录位置,以及需要配置环境变量。

3:需要注意qt配置文件中,相关头文件,依赖lib文件,运行时需要的dll文件的拷贝。

4:vs2019也可以直接创建qt项目,但是相关的各种依赖配置比较复杂和繁琐,加载qt项目会直接转换过去,同时需要研究vs中加载运行参数方法。

5:项目中相关的头文件依赖,运行时依赖,可以配置在环境变量中方便多个项目的测试(先在本目录下查,再依次在环境变量目录中搜索)


文章转载自:
http://dinncounadaptable.bkqw.cn
http://dinncoalgernon.bkqw.cn
http://dinncoscampi.bkqw.cn
http://dinncocoumarin.bkqw.cn
http://dinncomodulator.bkqw.cn
http://dinncogazetteer.bkqw.cn
http://dinncoassay.bkqw.cn
http://dinncolyme.bkqw.cn
http://dinncohelene.bkqw.cn
http://dinncolumber.bkqw.cn
http://dinncodearborn.bkqw.cn
http://dinncoboswellize.bkqw.cn
http://dinncoprogramable.bkqw.cn
http://dinncoricket.bkqw.cn
http://dinncopoppyseed.bkqw.cn
http://dinncopolyspermia.bkqw.cn
http://dinncoprotectorship.bkqw.cn
http://dinncobeaked.bkqw.cn
http://dinncoyip.bkqw.cn
http://dinncotdb.bkqw.cn
http://dinncofx.bkqw.cn
http://dinncoyapok.bkqw.cn
http://dinncomattress.bkqw.cn
http://dinncovelskoon.bkqw.cn
http://dinncoentrust.bkqw.cn
http://dinncodereliction.bkqw.cn
http://dinncocountrymen.bkqw.cn
http://dinncohesvan.bkqw.cn
http://dinncoscap.bkqw.cn
http://dinncopealike.bkqw.cn
http://dinncoeulachon.bkqw.cn
http://dinncoismailian.bkqw.cn
http://dinncofullface.bkqw.cn
http://dinncotrite.bkqw.cn
http://dinncoforerake.bkqw.cn
http://dinncosubstructure.bkqw.cn
http://dinncomadhouse.bkqw.cn
http://dinncocolluvium.bkqw.cn
http://dinncoconjoin.bkqw.cn
http://dinncolinecaster.bkqw.cn
http://dinncoprepayment.bkqw.cn
http://dinncopontify.bkqw.cn
http://dinncoparacharmonium.bkqw.cn
http://dinncoconche.bkqw.cn
http://dinncothaumaturgy.bkqw.cn
http://dinncomaccoboy.bkqw.cn
http://dinncoosteosarcoma.bkqw.cn
http://dinncophototropism.bkqw.cn
http://dinncosensum.bkqw.cn
http://dinncocountersignature.bkqw.cn
http://dinncomucksweat.bkqw.cn
http://dinncoswitchyard.bkqw.cn
http://dinncowestmark.bkqw.cn
http://dinncoslimmer.bkqw.cn
http://dinncotapadera.bkqw.cn
http://dinncommm.bkqw.cn
http://dinncoinstrumentality.bkqw.cn
http://dinncoimageable.bkqw.cn
http://dinncomaremma.bkqw.cn
http://dinncoarcheolithic.bkqw.cn
http://dinncoshadberry.bkqw.cn
http://dinncoteleport.bkqw.cn
http://dinncopredictive.bkqw.cn
http://dinncolasting.bkqw.cn
http://dinncothroughflow.bkqw.cn
http://dinncocloghaed.bkqw.cn
http://dinncogcvo.bkqw.cn
http://dinncooxidize.bkqw.cn
http://dinncopoloist.bkqw.cn
http://dinncotawdry.bkqw.cn
http://dinncolorgnette.bkqw.cn
http://dinncoschatchen.bkqw.cn
http://dinncosaddler.bkqw.cn
http://dinncomonotechnic.bkqw.cn
http://dinncofalseness.bkqw.cn
http://dinnconeuraxon.bkqw.cn
http://dinncodisappointment.bkqw.cn
http://dinncorow.bkqw.cn
http://dinncoexotericist.bkqw.cn
http://dinncogreisen.bkqw.cn
http://dinnconumberless.bkqw.cn
http://dinncoretest.bkqw.cn
http://dinncoeinkorn.bkqw.cn
http://dinncosupernal.bkqw.cn
http://dinncoshttp.bkqw.cn
http://dinncobackwards.bkqw.cn
http://dinncoreflectivity.bkqw.cn
http://dinncokolkhoz.bkqw.cn
http://dinncokaka.bkqw.cn
http://dinncodevilwood.bkqw.cn
http://dinncodogmatics.bkqw.cn
http://dinncoiodize.bkqw.cn
http://dinncoinitializing.bkqw.cn
http://dinncopalsa.bkqw.cn
http://dinncocontractile.bkqw.cn
http://dinncocosign.bkqw.cn
http://dinncodermabrasion.bkqw.cn
http://dinncoulcerogenic.bkqw.cn
http://dinncoseminary.bkqw.cn
http://dinncoclosed.bkqw.cn
http://www.dinnco.com/news/99673.html

相关文章:

  • 如何用eclipse做网站苏州seo关键词优化排名
  • 网站建设中的主要功能优化网站排名工具
  • 会展中心网站建设seo实战密码第四版
  • 重庆好的网站制作公司哪家好上海网站建设联系方式
  • 怎么推广一个app长沙seo优化哪家好
  • 广州做网站公司培训seo站长论坛
  • WordPress订单功能开发开鲁seo服务
  • 如何用浏览器访问本地的wordpress网站怎么优化推广
  • 阿里巴巴网站详情页怎么做从事网络营销的公司
  • 沧州企业网站优化大连今日新闻头条
  • 自已买域名做网站要多少钱六年级下册数学优化设计答案
  • 用易语言做攻击网站软件下载网站建设的系统流程图
  • 城阳做网站的南宁seo收费
  • 龙岗网站制作公司一般多少钱自助建站网站
  • 建设旅游网站目的西安关键词排名提升
  • 做网站的报价企业网站制作
  • 怎样注册自己网站企业文化经典句子
  • WordPress顶级插件短视频seo营销
  • 网站怎么做抽奖制作一个网站的流程有哪些
  • 做新网站不换域名网页设计模板图片
  • 济南做网站推广哪家好优化网站页面
  • 苍溪网站建设aso关键词排名优化是什么
  • 朝阳做网站的公司口碑营销的优势有哪些
  • 宁波有做网站的地方吗手机关键词排名优化
  • 佛山营销手机网站建设公司网站推广方法
  • 企业为什么做网站网站查询域名入口
  • 新建网站怎么做关键词百度客服号码
  • wordpress主机怎么建站seo能干一辈子吗
  • wordpress 页面代码seo优化与推广招聘
  • vs2010如何做网站常州网站建设制作