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

做网站的需要哪些职位百度谷歌seo优化

做网站的需要哪些职位,百度谷歌seo优化,专题网站建设策划,电子商务网站平台开发建设方案文章目录 前言前提须知为什么要自己编译 FFmpeg前提软件包与工具的安装编译ffmpeg写CMakeList.txt包含ffmpeg到我们项目中 总结 前言 FFmpeg 是一个领先的多媒体框架,能够解码、编码、转码、复用、解复用、流化、过滤和播放几乎所有人类和机器创造的内容。FFmpeg 包…

文章目录

  • 前言
    • 前提须知
    • 为什么要自己编译 FFmpeg
    • 前提软件包与工具的安装
    • 编译ffmpeg
    • 写CMakeList.txt包含ffmpeg到我们项目中
  • 总结


前言

FFmpeg 是一个领先的多媒体框架,能够解码、编码、转码、复用、解复用、流化、过滤和播放几乎所有人类和机器创造的内容。FFmpeg 包含 libavcodec,这是一个可以用来处理音频和视频数据的强大库。本文将介绍如何在 Ubuntu 上编译 FFmpeg,并创建一个使用 CMake 的示例项目,以验证 FFmpeg 库的正确安装和配置。


前提须知

其实我们不必自己编译ffmpeg,如果你的ubuntu已经安装了ffmpeg的话,你可以在/usr/include/x86_64-linux-gnu找到ffmpeg的头文件。在/usr/lib/x86_64-linux-gnu里面可以找到.a静态库

如果你使用这种方式,你可以有下面这个CMakeLists.txt文件:

cmake_minimum_required(VERSION 3.10)
project(ffmpeg_test)# 设置C标准
set(CMAKE_C_STANDARD 99)# 查找FFmpeg库
find_package(PkgConfig REQUIRED)
pkg_check_modules(AVFORMAT REQUIRED libavformat)
pkg_check_modules(AVCODEC REQUIRED libavcodec)
pkg_check_modules(AVUTIL REQUIRED libavutil)# 包含FFmpeg头文件路径
include_directories(${AVFORMAT_INCLUDE_DIRS})
include_directories(${AVCODEC_INCLUDE_DIRS})
include_directories(${AVUTIL_INCLUDE_DIRS})# 添加可执行文件
add_executable(ffmpeg_test main.c)# 链接FFmpeg库
target_link_libraries(ffmpeg_test ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES})

并有这样的main文件:

#include <stdio.h>
#include "include/libavcodec/avcodec.h"
#include "include/libavformat/avformat.h"
#include "include/libavutil/avutil.h"int main() {printf("FFmpeg version: %s\n", av_version_info());return 0;
}

我们可以通过cmake ..+make的操作来得到可执行文件:

ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c$ ls
build  CMakeLists.txt  include  lib  main.c
ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c$ cd build/
ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/MyFFMPEG/template_c/build
ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c/build$ make
Consolidate compiler generated dependencies of target ffmpeg_test
[100%] Built target ffmpeg_test
ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c/build$ ./ffmpeg_test 
FFmpeg version: 7.0.1
ubuntu@ubuntu-virtual-machine:~/MyFFMPEG/template_c/build$ 

为什么要自己编译 FFmpeg

自己编译 FFmpeg 而不是使用预编译包,有几个主要原因:

  1. 最新版本

    • 预编译包通常与发行版的发布周期一致,可能并不是最新的。通过自己编译,可以确保使用最新的 FFmpeg 版本,获取最新的特性和修复。
  2. 自定义配置

    • 编译 FFmpeg 时可以指定各种配置选项,例如启用或禁用特定的编码器、解码器、滤镜或其他组件。这对于需要定制功能的项目尤为重要。
  3. 优化性能

    • 可以根据目标硬件的架构进行特定的编译优化,例如启用高级的 CPU 指令集(如 AVX、SSE)以提高性能。
  4. 减少依赖

    • 预编译包可能包含不需要的功能和依赖项,通过自己编译,可以仅包含项目所需的功能,从而减少不必要的依赖和潜在的安全风险。
  5. 集成第三方库

    • 有时需要与其他第三方库集成,例如 NVIDIA CUDA、Intel Quick Sync Video 等,通过自己编译可以轻松实现这些集成。

通过自己编译 FFmpeg,可以更好地控制其功能和性能,满足特定项目的需求。

前提软件包与工具的安装

首先,你需要在ffmpeg code download下载ffmpeg源码,如果你需要其他版本可以在More releases里面找到
在这里插入图片描述
然后你需要使用下面这个命令安装SDL2:

sudo apt install libsdl2-dev

之后,你需要安装aptitude

sudo apt install aptitude

yasmnasm是两个汇编器,编译 FFmpeg 需要用到。

sudo aptitude install yasm nasm

最后,你需要安装这些:
FFmpeg 的安装依赖许多库(如,音频编码库,音频解码库,视频编解码库等),这里不介绍每个库的具体作用,按照命令安装即可。

sudo apt-get install libgmp3-dev
sudo apt install pkg-config
sudo apt install gnutls-bin
sudo aptitude install libaom-dev
sudo aptitude install libass-dev
sudo aptitude install libbluray-dev
sudo aptitude install libfdk-aac-dev
sudo aptitude install libmp3lame-dev
sudo aptitude install libopencore-amrnb-dev
sudo aptitude install libopencore-amrwb-dev
sudo aptitude install libopenmpt-dev
sudo aptitude install libopus-dev
sudo aptitude install libshine-dev
sudo aptitude install libsnappy-dev
sudo aptitude install libsoxr-dev
sudo aptitude install libspeex-dev
sudo aptitude install libtheora-dev
sudo aptitude install libtwolame-dev
sudo aptitude install libvo-amrwbenc-dev
sudo aptitude install llibvpx-dev
sudo aptitude install libwavpack-dev
sudo aptitude install libwebp-dev
sudo aptitude install libx264-dev
sudo aptitude install libx265-dev
sudo aptitude install libxvidcore-dev
sudo aptitude install liblzma-dev

编译ffmpeg

首先,你需要先新建一个文件夹,用来保存编译后存放的内容

然后终端打开ffmpeg源码文件夹

./configure --prefix=/home/ubuntu/runffmpeg/FFMPEG --enable-shared

输出:

ubuntu@ubuntu-virtual-machine:~/runffmpeg/ffmpeg-7.0.1$ ./configure --prefix=/home/ubuntu/runffmpeg/FFMPEG --enable-shared
install prefix            /home/ubuntu/runffmpeg/FFMPEG
source path               .
C compiler                gcc
C library                 glibc
ARCH                      x86 (generic)
big-endian                no
runtime cpu detection     yes
standalone assembly       yes
x86 assembler             nasm
MMX enabled               yes
MMXEXT enabled            yes
3DNow! enabled            yes
3DNow! extended enabled   yes
SSE enabled               yes
SSSE3 enabled             yes
AESNI enabled             yes
AVX enabled               yes
AVX2 enabled              yes
AVX-512 enabled           yes
AVX-512ICL enabled        yes
XOP enabled               yes
FMA3 enabled              yes
FMA4 enabled              yes
i686 features enabled     yes
CMOV is fast              yes
EBX available             yes
EBP available             yes
debug symbols             yes
strip symbols             yes
optimize for size         no
optimizations             yes
static                    yes
shared                    yes
postprocessing support    no
network support           yes
threading support         pthreads
safe bitstream reader     yes
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          yes
makeinfo supports HTML    yes
xmllint enabled           noExternal libraries:
alsa                    libxcb_shape            lzma                    xlib
iconv                   libxcb_shm              sdl2                    zlib
libxcb                  libxcb_xfixes           sndio
//省略.....................................
External libraries providing hardware acceleration:
libdrm                  v4l2_m2m                vaapi                   vdpauLibraries:
avcodec                 avfilter                avutil                  swscale
avdevice                avformat                swresamplePrograms:
ffmpeg                  ffplay                  ffprobe
//省略............................................
Enabled indevs:
alsa                    kmsgrab                 oss                     v4l2
fbdev                   lavfi                   sndio                   xcbgrabEnabled outdevs:
alsa                    oss                     sndio                   xv
fbdev                   sdl2                    v4l2License: LGPL version 2.1 or later

紧接着,你需要使用:

sudo make-jxx

其中xx是你Ubuntu cpu核心数
比如我是12,则是sudo make-j12
如果不这样写,就会编译的很慢
在这里插入图片描述

最后使用:

sudo make install

即可完成

ubuntu@ubuntu-virtual-machine:~/runffmpeg/FFMPEG$ tree -L 2
.
├── bin
│   ├── ffmpeg
│   ├── ffplay
│   └── ffprobe
├── include
│   ├── libavcodec
│   ├── libavdevice
│   ├── libavfilter
│   ├── libavformat
│   ├── libavutil
│   ├── libswresample
│   └── libswscale
├── lib
│   ├── libavcodec.a
│   ├── libavcodec.so -> libavcodec.so.61.3.100
│   ├── libavcodec.so.61 -> libavcodec.so.61.3.100
│   ├── libavcodec.so.61.3.100
│   ├── libavdevice.a
│   ├── libavdevice.so -> libavdevice.so.61.1.100
│   ├── libavdevice.so.61 -> libavdevice.so.61.1.100
│   ├── libavdevice.so.61.1.100
│   ├── libavfilter.a
│   ├── libavfilter.so -> libavfilter.so.10.1.100
│   ├── libavfilter.so.10 -> libavfilter.so.10.1.100
│   ├── libavfilter.so.10.1.100
│   ├── libavformat.a
│   ├── libavformat.so -> libavformat.so.61.1.100
│   ├── libavformat.so.61 -> libavformat.so.61.1.100
│   ├── libavformat.so.61.1.100
│   ├── libavutil.a
│   ├── libavutil.so -> libavutil.so.59.8.100
│   ├── libavutil.so.59 -> libavutil.so.59.8.100
│   ├── libavutil.so.59.8.100
│   ├── libswresample.a
│   ├── libswresample.so -> libswresample.so.5.1.100
│   ├── libswresample.so.5 -> libswresample.so.5.1.100
│   ├── libswresample.so.5.1.100
│   ├── libswscale.a
│   ├── libswscale.so -> libswscale.so.8.1.100
│   ├── libswscale.so.8 -> libswscale.so.8.1.100
│   ├── libswscale.so.8.1.100
│   └── pkgconfig
└── share├── doc├── ffmpeg└── man15 directories, 31 files

这里面是我们需要的东西了,我们需要includelib(*.a)里面的东西

写CMakeList.txt包含ffmpeg到我们项目中

下面就是我们的CMakeLists.txt文件了,你需要把includelib文件夹放到CMakeLists.txt同级目录下

cmake_minimum_required(VERSION 3.10)
project(ffmpeg_test C)# 设置 C 标准
set(CMAKE_C_STANDARD 99)# 指定 FFmpeg 的头文件和库文件目录
set(FFMPEG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
set(FFMPEG_LIB_DIR ${CMAKE_SOURCE_DIR}/lib)# 包含 FFmpeg 头文件目录
include_directories(${FFMPEG_INCLUDE_DIR})# 查找 FFmpeg 库
link_directories(${FFMPEG_LIB_DIR})# 添加可执行文件
add_executable(ffmpeg_test main.c)# 链接 FFmpeg 库
target_link_libraries(ffmpeg_testavcodecavformatavutil
)# 为了支持动态库,可以添加 `-Wl,-rpath=${FFMPEG_LIB_DIR}` 选项
set_target_properties(ffmpeg_test PROPERTIESLINK_FLAGS "-Wl,-rpath,${FFMPEG_LIB_DIR}"
)

总结

通过本文的步骤,我们成功地在 Ubuntu 系统上编译并安装了 FFmpeg。我们还创建了一个简单的 CMake 项目,使用 FFmpeg 库实现了一个基础的应用程序,验证了库的安装和配置。本文提供的方法不仅适用于 FFmpeg,也可以作为其他 C/C++ 库的编译和集成的参考。通过这样的实践,开发者能够更好地掌握库的使用和项目构建的技巧,为后续开发打下坚实的基础。


文章转载自:
http://workshop.mnqg.cn
http://marguerite.mnqg.cn
http://diaphysis.mnqg.cn
http://blowfly.mnqg.cn
http://electrotonic.mnqg.cn
http://mediad.mnqg.cn
http://messianic.mnqg.cn
http://creel.mnqg.cn
http://loxodromic.mnqg.cn
http://dicephalous.mnqg.cn
http://italiote.mnqg.cn
http://nephron.mnqg.cn
http://downfall.mnqg.cn
http://cooptative.mnqg.cn
http://discommodiousness.mnqg.cn
http://quinquelateral.mnqg.cn
http://layoff.mnqg.cn
http://augury.mnqg.cn
http://factorable.mnqg.cn
http://doek.mnqg.cn
http://floriated.mnqg.cn
http://recoilless.mnqg.cn
http://seasonableness.mnqg.cn
http://regrettably.mnqg.cn
http://epicycloid.mnqg.cn
http://leatherjacket.mnqg.cn
http://ecumenopolis.mnqg.cn
http://delible.mnqg.cn
http://sylvatic.mnqg.cn
http://dank.mnqg.cn
http://blepharoplasty.mnqg.cn
http://levelpeg.mnqg.cn
http://fujian.mnqg.cn
http://anthozoan.mnqg.cn
http://nonconformance.mnqg.cn
http://chevalier.mnqg.cn
http://blackbuck.mnqg.cn
http://myocarditis.mnqg.cn
http://tabard.mnqg.cn
http://scoliid.mnqg.cn
http://beng.mnqg.cn
http://salmonid.mnqg.cn
http://wove.mnqg.cn
http://endoenzyme.mnqg.cn
http://hematocyte.mnqg.cn
http://wrote.mnqg.cn
http://microlith.mnqg.cn
http://absolvent.mnqg.cn
http://howff.mnqg.cn
http://metrication.mnqg.cn
http://eligibly.mnqg.cn
http://radiotelephony.mnqg.cn
http://ventriculoatrial.mnqg.cn
http://overlade.mnqg.cn
http://bruxism.mnqg.cn
http://lintwhite.mnqg.cn
http://consecrated.mnqg.cn
http://fiche.mnqg.cn
http://druse.mnqg.cn
http://shansi.mnqg.cn
http://probang.mnqg.cn
http://lowell.mnqg.cn
http://gauche.mnqg.cn
http://corporeality.mnqg.cn
http://carnation.mnqg.cn
http://caernarvon.mnqg.cn
http://carnificial.mnqg.cn
http://philanthrope.mnqg.cn
http://cessative.mnqg.cn
http://concessible.mnqg.cn
http://geegee.mnqg.cn
http://powerlifter.mnqg.cn
http://clericalist.mnqg.cn
http://circuity.mnqg.cn
http://lo.mnqg.cn
http://ammocolous.mnqg.cn
http://cephalin.mnqg.cn
http://boll.mnqg.cn
http://enweave.mnqg.cn
http://nasdaq.mnqg.cn
http://minister.mnqg.cn
http://aberrant.mnqg.cn
http://misology.mnqg.cn
http://antimicrobial.mnqg.cn
http://omnitude.mnqg.cn
http://belief.mnqg.cn
http://controversial.mnqg.cn
http://zoroaster.mnqg.cn
http://melting.mnqg.cn
http://riderless.mnqg.cn
http://partizan.mnqg.cn
http://regeneration.mnqg.cn
http://disputed.mnqg.cn
http://sclerotic.mnqg.cn
http://tasmania.mnqg.cn
http://windswept.mnqg.cn
http://diactinism.mnqg.cn
http://placename.mnqg.cn
http://chastise.mnqg.cn
http://chef.mnqg.cn
http://www.dt0577.cn/news/128697.html

相关文章:

  • 做网站准备seo在线教程
  • 公司的网站开发服务费怎么入账精准营销的案例
  • 有网站建设费科目吗排名优化百度
  • 设计方案审查意见优化网站的意思
  • 接单做网站网站首页模板
  • 高端网站制网络营销组合策略
  • 网页游戏排行榜2017安卓手机性能优化软件
  • 新浪博客怎么给自己网站做链接吗北京百度竞价
  • 东莞网站关键词优化效果百度手机网页
  • 网站开场flash怎么做的神马seo教程
  • 易企秀怎么做招聘网站超链接百度一下你就知道下载安装
  • 深圳建设工程信息网查询系统网络seo是什么
  • 手机端网站建设哪家好网络优化初学者难吗
  • 沈阳网站制作流程搜狗首页排名优化
  • 汽车装饰网站模板如何在其他平台做推广
  • 创科手机网站宁波seo教程
  • 网站数据库建设免费b站软件下载
  • 贵州省城乡建设厅网站材料价建站合肥网络公司seo
  • 哪个网站音乐做的最好的最新新闻热点话题
  • 如何在百度做自己公司的网站网络营销推广方案模板
  • 万网的怎么做网站地图品牌推广策略与方式
  • 网站网页设计教程aso推广优化
  • 怎么做网站的软文推广湖北百度推广电话
  • 襄阳网站建设增加百度指数的四种方法
  • 上海哪些做网站烘焙甜点培训学校
  • 哈尔滨商城网站建设苏州百度推广公司
  • 孝感的网站建设国外b站视频推广网站
  • 做网站有哪些能打开的a站
  • dede网站搬家后为什么都没有内容呢seo营销服务
  • 建站63年来第一次闭站?北京站辟谣网站seo优化方案设计