前言:
而今我们对“ubuntu改名命令”大约比较着重,小伙伴们都需要剖析一些“ubuntu改名命令”的相关内容。那么小编也在网上收集了一些有关“ubuntu改名命令””的相关内容,希望各位老铁们能喜欢,各位老铁们快快来了解一下吧!欢迎访问我的GitHub
这里分类和汇总了欣宸的全部原创(含配套源码):
准备请提前安装好ubuntu操作系统,我这里是在windows电脑上用wsl2安装的,详细安装过程可以次参考《win11安装ubuntu(by wsl2)》Ubuntu:22.04.2LTSFFmpeg:4.4.3参考信息(来自rq973017553)本次实战会用到很多shell脚本,这些脚本将整个编译过程变得无比简单,要说明的是,这些脚本并非欣宸原创,而是来自: ,感谢这位大佬的无私分享!下载文件下载所有脚本的压缩包,地址是:下载FFmpeg,去官网下载,地址:我这边选择的是4.4版本
解压并正确放置登录ubuntu,解压ffmpeg_build.tar.gz,得到名为ffmpeg_build的文件夹,整个包结构是这样的
tree ffmpeg_buildffmpeg_build├── build.sh├── build_ffmpeg.sh├── build_libfdk_aac.sh├── build_libmp3lame.sh├── build_libopus.sh├── build_libvpx.sh├── build_libx264.sh├── build_libx265.sh├── build_pkg_config.sh├── build_sdl2.sh├── build_yasm.sh├── config.sh└── tools.sh给所有sh文件可执行权限
chmod a+x ffmpeg_build/*.sh解压FFmpeg的源码
tar -xf ffmpeg-4.4.3.tar.xz解压后得到了名为ffmpeg-4.4.3的文件夹,将此文件夹改名为FFmpeg,然后移动到ffmpeg_build目录下现在的目录结构是这样的
tree ffmpeg_build -L 2ffmpeg_build├── FFmpeg│ ├── CONTRIBUTING.md│ ├── COPYING.GPLv2│ ├── COPYING.GPLv3│ ├── COPYING.LGPLv2.1│ ├── COPYING.LGPLv3│ ├── CREDITS│ ├── Changelog│ ├── INSTALL.md│ ├── LICENSE.md│ ├── MAINTAINERS│ ├── Makefile│ ├── README.md│ ├── RELEASE│ ├── RELEASE_NOTES│ ├── VERSION│ ├── compat│ ├── configure│ ├── doc│ ├── ffbuild│ ├── fftools│ ├── libavcodec│ ├── libavdevice│ ├── libavfilter│ ├── libavformat│ ├── libavresample│ ├── libavutil│ ├── libpostproc│ ├── libswresample│ ├── libswscale│ ├── presets│ ├── tests│ └── tools├── build.sh├── build_ffmpeg.sh├── build_libfdk_aac.sh├── build_libmp3lame.sh├── build_libopus.sh├── build_libvpx.sh├── build_libx264.sh├── build_libx265.sh├── build_pkg_config.sh├── build_sdl2.sh├── build_yasm.sh├── config.sh└── tools.sh安装依赖软件以下软件需要是编译过程中要用到的,这里一次性装好先更新源
sudo apt-get update安装build-essential和cmake(否则会报错:no acceptable C compiler found in $PATH)
sudo apt-get install -y build-essential cmake安装FFmpeg在ffmpeg_build 目录下执行以下命令即可完成安装
./build.sh安装期间因为网络问题,大概率会失败(超时、域名解析额失败、下载的文件解压失败等等),这时候多试几次如果遇到文件解压失败,记得删除掉对应文件再重试安装成功后,如果安装成功会输出以下内容,统计安装耗时,并调用ffmpeg命令验证是否可用
INSTALL libavutil/libavutil.pc==========================ffmpeg build successful!==========================Total Compilation Time 1486 seconds==========================test ffmpeg!==========================ffmpeg version 4.4.3 Copyright (c) 2000-2022 the FFmpeg developersbuilt with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)configuration: --prefix=/root/ffmpeg/ffmpeg_build/output --extra-cflags=-I/root/ffmpeg/ffmpeg_build/output/include --extra-ldflags=-L/root/ffmpeg/ffmpeg_build/output/lib --pkg-config-flags=--static --extra-libs=-lpthread --enable-ffplay --enable-gpl --enable-version3 --disable-optimizations --enable-debug --enable-nonfree --enable-filter=delogo --enable-static --disable-shared --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvpxlibavutil 56. 70.100 / 56. 70.100libavcodec 58.134.100 / 58.134.100libavformat 58. 76.100 / 58. 76.100libavdevice 58. 13.100 / 58. 13.100libavfilter 7.110.100 / 7.110.100libswscale 5. 9.100 / 5. 9.100libswresample 3. 9.100 / 3. 9.100libpostproc 55. 9.100 / 55. 9.100编辑成功后生成的文件在ffmpeg_build/output/bin目录下
tree ffmpeg_build/output/bin/ffmpeg_build/output/bin/├── ffmpeg├── ffplay├── ffprobe├── lame├── pkg-config├── sdl2-config├── vsyasm├── x264├── x265├── x86_64-unknown-linux-gnu-pkg-config├── yasm└── ytasm0 directories, 12 files验证生成的文件是否可用,进入ffmpeg_build/output/bin目录,执行命令
./ffprobe得到的结果如下,成功解析了远程流媒体文件
~/ffmpeg/ffmpeg_build/output/bin# ./ffprobe version 4.4.3 Copyright (c) 2007-2022 the FFmpeg developers built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04) configuration: --prefix=/root/ffmpeg/ffmpeg_build/output --extra-cflags=-I/root/ffmpeg/ffmpeg_build/output/include --extra-ldflags=-L/root/ffmpeg/ffmpeg_build/output/lib --pkg-config-flags=--static --extra-libs=-lpthread --enable-ffplay --enable-gpl --enable-version3 --disable-optimizations --enable-debug --enable-nonfree --enable-filter=delogo --enable-static --disable-shared --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvpx libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ';: Metadata: major_brand : mp42 minor_version : 1 compatible_brands: mp42avc1 creation_time : 2010-02-09T01:55:39.000000Z Duration: 00:01:00.10, start: 0.000000, bitrate: 733 kb/s Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 65 kb/s (default) Metadata: creation_time : 2010-02-09T01:55:39.000000Z handler_name : Apple Sound Media Handler vendor_id : [0][0][0][0] Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360, 612 kb/s, 23.96 fps, 24 tbr, 600 tbn, 1200 tbc (default) Metadata: creation_time : 2010-02-09T01:55:39.000000Z handler_name : Apple Video Media Handler vendor_id : [0][0][0][0] Stream #0:2(eng): Data: none (rtp / 0x20707472), 45 kb/s Metadata: creation_time : 2010-02-09T01:55:39.000000Z handler_name : hint media handler Stream #0:3(eng): Data: none (rtp / 0x20707472), 5 kb/s Metadata: creation_time : 2010-02-09T01:55:39.000000Z handler_name : hint media handlerUnsupported codec with id 0 for input stream 2Unsupported codec with id 0 for input stream 3至此,验证通过,编译成功其他如果想做一些个性化调整,例如开启或关闭一些编译项目,您可以自行修改shell脚本,例如和ffmpeg相关的都在build_ffmpeg.sh
欢迎关注头条号:程序员欣宸学习路上,你不孤单,欣宸原创一路相伴...
版权声明:
本站文章均来自互联网搜集,如有侵犯您的权益,请联系我们删除,谢谢。
标签: #ubuntu改名命令 #ubuntu编译运行 #ubuntu下编译后内存占用怎么清除 #mpeg4aacubuntu #ubuntu编译安装ffmpeg