包括 解 / 编码
、(复杂)滤波器
、屏幕 / 摄像头 / 音频捕获
、音视频播放
的基础示例以及相关教程。
Examples and tutorials for decoding / encoding
, (complex) filtering
, screen, camera, and audio capture
, audio / video playing
, etc.
- remuxing
- transcoding
- camera / screen / microphone recording
- simple filter
- complex filter
- generating high quality GIF
- audio player with Qt
- video player with Qt
- media player with Qt (syncing audio and video)
- RTMP Streaming
- hardware acceleration
- Windows - WASAPI : audio capture
- Windows - WASAPI : audio rendering
- Windows - Windows Graphics Capture : screen capture
- Linux - PulseAudio : audio capture
- Linux - V4L2 : camera capture
- Windows - DirectShow : camera capture
Windows Graphics Capture
示例需要较高的Windows版本:
Windows Version >= 10.0.17134.48
(akaWindows 10 Version 1803
)Windows SDK Version >= 10.0.20348.0
FFmpeg >= 6.0
如果你的Windows或SDK不能满足要求,你可以选择:
- 通过
-DDISABLE_WGC=ON
来禁用Windows Graphics Capture
示例 - 通过
Visual Studio Installer
安装最新的Windows SDK
Version : > 4.3 (-DDISABLE_WGC=OFF : >= 6.0)
- Windows builds: 注意下载
shared
版本,添加到环境变量中 - Build from source
6.0 > Version >= 5.12
- Download: 安装后注意添加目录到环境变量中
sudo apt install build-essential git cmake
sudo apt install ffmpeg libavfilter-dev libavdevice-dev libavutil-dev libavformat-dev libswresample-dev libswscale-dev
# Ubuntu 20.04
sudo apt install qt5-default libqt5x11extras5-dev qtmultimedia5-dev
# Ubuntu 22.04
sudo apt install qtbase5-dev libqt5x11extras5-dev qtmultimedia5-dev
# pulse
sudo apt install libpulse-dev
# v4l2
sudo apt install libv4l-dev v4l-utils
# for error: GL/gl.h: No such file or directory
sudo apt install mesa-common-dev
- C++ 20
- CMake >= 3.16
No installation required
- glog: Google Logging (glog) is a C++98 library that implements application-level logging. The library provides logging APIs based on C++-style streams and various helper macros.
- fmt: {fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams.
git clone https://github.com/ffiirree/ffmpeg_examples.git --recursive
# 或者单独获取子模块
git submodule init
git submodule update