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

安装SDL和FFmpeg

1、先记录SDL
这玩意还是有一点讲究的

具体步骤:
下载 SDL包:
链接:https://www.libsdl.org/release/SDL2-2.0.14.tar.gz

可以用迅雷,下载完之后,
解压:

tar -zxvf SDL2-2.0.14.tar.gz

进入安装目录

cd SDL2-2.0.14

这里推荐先安装几个包

sudo apt install libsdl2-dev
sudo apt install libwayland-dev wayland-protocols
# 如果存在安装失败的情况
# 判断依据
pkg-config --cflags --libs wayland-client
# 如果返回的值是
-I/usr/include -L/usr/lib/x86_64-linux-gnu -lwayland-client
# 那就没啥问题
# 否则 执行 reinstall 
sudo apt install --reinstall libwayland-dev wayland-protocols# 安装完了记得看看是不是在
find /usr -name "libwayland-client.so*" 2>/dev/null
#返回这些 就ok
/usr/lib/x86_64-linux-gnu/libwayland-client.so
/usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0
/usr/lib/x86_64-linux-gnu/libwayland-client.so.0

开始编译

./configure --prefix=$PWD/_install

如果存在wayland找不到,那就手动指定wayland的位置

./configure --prefix=$PWD/_install LDFLAGS="-L/usr/lib/x86_64-linux-gnu -lwayland-client"

编译完成后 安装

make && make install

然后就可以看见,没有报错,最多输出一些警告

 ./configure --prefix=$PWD/_install LDFLAGS="-L/usr/lib/x86_64-linux-gnu -lwayland-client"checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
……/bin/bash build-scripts/mkinstalldirs /home/ctt/Desktop/SDL2-2.0.14/_install/lib
mkdir -p -- /home/ctt/Desktop/SDL2-2.0.14/_install/lib
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2.la /home/ctt/Desktop/SDL2-2.0.14/_install/lib/libSDL2.la
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2main.la /home/ctt/Desktop/SDL2-2.0.14/_install/lib/libSDL2main.la
/bin/bash ./libtool --quiet --mode=install /usr/bin/install -c build/libSDL2_test.la /home/ctt/Desktop/SDL2-2.0.14/_install/lib/libSDL2_test.la
/bin/bash build-scripts/mkinstalldirs /home/ctt/Desktop/SDL2-2.0.14/_install/share/aclocal
mkdir -p -- /home/ctt/Desktop/SDL2-2.0.14/_install/share/aclocal
/usr/bin/install -c -m 644 /home/ctt/Desktop/SDL2-2.0.14/sdl2.m4 /home/ctt/Desktop/SDL2-2.0.14/_install/share/aclocal/sdl2.m4
/bin/bash build-scripts/mkinstalldirs /home/ctt/Desktop/SDL2-2.0.14/_install/lib/pkgconfig
mkdir -p -- /home/ctt/Desktop/SDL2-2.0.14/_install/lib/pkgconfig
/usr/bin/install -c -m 644 sdl2.pc /home/ctt/Desktop/SDL2-2.0.14/_install/lib/pkgconfig
/bin/bash build-scripts/mkinstalldirs /home/ctt/Desktop/SDL2-2.0.14/_install/lib/cmake/SDL2
mkdir -p -- /home/ctt/Desktop/SDL2-2.0.14/_install/lib/cmake/SDL2
/usr/bin/install -c -m 644 sdl2-config.cmake /home/ctt/Desktop/SDL2-2.0.14/_install/lib/cmake/SDL2
/usr/bin/install -c -m 644 sdl2-config-version.cmake /home/ctt/Desktop/SDL2-2.0.14/_install/lib/cmake/SDL2

打开安装目录

cd _install
# 查看:~/Desktop/SDL2-2.0.14/_install$ ls
bin  include  lib  share

可以下载一个 tree 看一下里面的结构,比较清晰

:~/Desktop/SDL2-2.0.14/_install$ sudo apt install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
:~/Desktop/SDL2-2.0.14/_install$ tree
.
├── bin
│   └── sdl2-config
├── include
│   └── SDL2
│       ├── begin_code.h
│       ├── close_code.h
│       ├── SDL_assert.h
│       ├── SDL_atomic.h
│       ├── SDL_audio.h
│       ├── SDL_bits.h
│       ├── SDL_blendmode.h
│       ├── SDL_clipboard.h
│       ├── SDL_config.h
│       ├── SDL_cpuinfo.h
│       ├── SDL_egl.h
│       ├── SDL_endian.h
│       ├── SDL_error.h
│       ├── SDL_events.h
│       ├── SDL_filesystem.h
│       ├── SDL_gamecontroller.h
│       ├── SDL_gesture.h
│       ├── SDL.h
│       ├── SDL_haptic.h
│       ├── SDL_hints.h
│       ├── SDL_joystick.h
│       ├── SDL_keyboard.h
│       ├── SDL_keycode.h
│       ├── SDL_loadso.h
│       ├── SDL_locale.h
│       ├── SDL_log.h
│       ├── SDL_main.h
│       ├── SDL_messagebox.h
│       ├── SDL_metal.h
│       ├── SDL_misc.h
│       ├── SDL_mouse.h
│       ├── SDL_mutex.h
│       ├── SDL_name.h
│       ├── SDL_opengles2_gl2ext.h
│       ├── SDL_opengles2_gl2.h
│       ├── SDL_opengles2_gl2platform.h
│       ├── SDL_opengles2.h
│       ├── SDL_opengles2_khrplatform.h
│       ├── SDL_opengles.h
│       ├── SDL_opengl_glext.h
│       ├── SDL_opengl.h
│       ├── SDL_pixels.h
│       ├── SDL_platform.h
│       ├── SDL_power.h
│       ├── SDL_quit.h
│       ├── SDL_rect.h
│       ├── SDL_render.h
│       ├── SDL_revision.h
│       ├── SDL_rwops.h
│       ├── SDL_scancode.h
│       ├── SDL_sensor.h
│       ├── SDL_shape.h
│       ├── SDL_stdinc.h
│       ├── SDL_surface.h
│       ├── SDL_system.h
│       ├── SDL_syswm.h
│       ├── SDL_test_assert.h
│       ├── SDL_test_common.h
│       ├── SDL_test_compare.h
│       ├── SDL_test_crc32.h
│       ├── SDL_test_font.h
│       ├── SDL_test_fuzzer.h
│       ├── SDL_test.h
│       ├── SDL_test_harness.h
│       ├── SDL_test_images.h
│       ├── SDL_test_log.h
│       ├── SDL_test_md5.h
│       ├── SDL_test_memory.h
│       ├── SDL_test_random.h
│       ├── SDL_thread.h
│       ├── SDL_timer.h
│       ├── SDL_touch.h
│       ├── SDL_types.h
│       ├── SDL_version.h
│       ├── SDL_video.h
│       └── SDL_vulkan.h
├── lib
│   ├── cmake
│   │   └── SDL2
│   │       ├── sdl2-config.cmake
│   │       └── sdl2-config-version.cmake
│   ├── libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.14.0
│   ├── libSDL2-2.0.so.0.14.0
│   ├── libSDL2.a
│   ├── libSDL2.la
│   ├── libSDL2main.a
│   ├── libSDL2main.la
│   ├── libSDL2.so -> libSDL2-2.0.so.0.14.0
│   ├── libSDL2_test.a
│   ├── libSDL2_test.la
│   └── pkgconfig
│       └── sdl2.pc
└── share└── aclocal└── sdl2.m4
10 directories, 90 files
:~/Desktop/SDL2-2.0

这就安装好了,剩下的就交由 FFmpeg 和 SDL进行串联开发了。
FFmpeg 的安装比较简单,我选择的是在conda中,直接用

pip install FFmpeg 

然后测试

ffmpeg
ffmpeg version 4.4.2 Copyright (c) 2000-2021 the FFmpeg developersbuilt with gcc 12.3.0 (conda-forge gcc 12.3.0-2)configuration: --prefix=/home/ctt/anaconda3/envs/skyeye --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1697113881276/_build_env/bin/x86_64-conda-linux-gnu-cc --cxx=/home/conda/feedstock_root/build_artifacts/ffmpeg_1697113881276/_build_env/bin/x86_64-conda-linux-gnu-c++ --nm=/home/conda/feedstock_root/build_artifacts/ffmpeg_1697113881276/_build_env/bin/x86_64-conda-linux-gnu-nm --ar=/home/conda/feedstock_root/build_artifacts/ffmpeg_1697113881276/_build_env/bin/x86_64-conda-linux-gnu-ar --disable-doc --disable-openssl --enable-avresample --enable-demuxer=dash --enable-hardcoded-tables --enable-libfreetype --enable-libfontconfig --enable-libopenh264 --enable-gnutls --enable-libmp3lame --enable-libvpx --enable-pthreads --enable-vaapi --enable-gpl --enable-libx264 --enable-libx265 --enable-libaom --enable-libsvtav1 --enable-libxml2 --enable-pic --enable-shared --disable-static --enable-version3 --enable-zlib --pkg-config=/home/conda/feedstock_root/build_artifacts/ffmpeg_1697113881276/_build_env/bin/pkg-configlibavutil      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.100libavresample   4.  0.  0 /  4.  0.  0libswscale      5.  9.100 /  5.  9.100libswresample   3.  9.100 /  3.  9.100libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...Use -h to get full help or, even better, run 'man ffmpeg'

未完待续

http://www.xdnf.cn/news/4160.html

相关文章:

  • 强化学习ppo算法在大语言模型上跑通
  • [ 设计模式 ] | 单例模式
  • Android学习总结之GetX库篇(场景运用)
  • 智能合约在去中心化金融(DeFi)中的核心地位与挑战
  • 机器学习中常见搜索算法
  • 代码随想录算法训练营第三十二天
  • Scrapy爬虫实战:如何用Rules实现高效数据采集
  • STM32教程:DMA运用及代码(基于STM32F103C8T6最小系统板标准库开发)*详细教程*
  • Vue3响应式原理那些事
  • PyTorch 张量与自动微分操作
  • 研0大模型学习(第12天)
  • 《深入理解 Java 虚拟机》笔记
  • 三、【LLaMA-Factory实战】模型微调进阶:从LoRA到MoE的技术突破与工程实践
  • 一文读懂Python之pandas模块
  • Vite简单介绍
  • 亚马逊卖家复刻案例:用社群分层策略实现海外用户月均消费3.2次
  • 普通消元求解线性基并求解最大异或和
  • 【论文笔记】SOTR: Segmenting Objects with Transformers
  • 机器人强化学习入门学习笔记
  • 有效的数独(中等)
  • Qt中数据结构使用自定义类————附带详细示例
  • 2025年企业Radius认证服务器市场深度调研:中小企业身份安全投入产出比最优解
  • Untiy基础学习(六)MonoBehaviour基类的简单介绍
  • 形式化数学——Lean求值表达式
  • 【数据治理】数据架构设计
  • 2962. 统计最大元素出现至少 K 次的子数组
  • 1. 设计哲学:让字面量“活”起来,提升表达力和安全性
  • java stream
  • Python训练打卡Day16
  • 【AI绘画】Ottohans Beier风格雕刻版画