Installs FFmpeg on Ubuntu/Debian systems. Supports both system packages (fast) and compilation from source (full control).
Based on the official FFmpeg compilation guide.
- Ansible 2.10+
- Ubuntu 20.04+ or Debian 11+
ansible-galaxy install kovalevsky.ffmpegOr add to requirements.yml:
roles:
- name: kovalevsky.ffmpeg
src: https://github.com/kovalevsky/ansible-ffmpeg# Action: install, uninstall, or update
ffmpeg_role_action: install
# Use system packages (fast) or compile from source
ffmpeg_compile_codecs: false
# Remove apt dependencies on uninstall
ffmpeg_remove_deps: falseffmpeg_root_dir: "/home/{{ ansible_user }}"
ffmpeg_build_dir: "{{ ffmpeg_root_dir }}/ffmpeg_build"
ffmpeg_source_dir: "{{ ffmpeg_root_dir }}/ffmpeg_sources"
ffmpeg_bin_dir: "{{ ffmpeg_root_dir }}/bin"When ffmpeg_compile_codecs: true, FFmpeg is compiled with these libraries:
- x264 (H.264 encoder)
- x265 (HEVC encoder)
- fdk-aac (AAC encoder)
- opus (Opus codec)
- libvpx (VP8/VP9)
- hosts: servers
roles:
- role: kovalevsky.ffmpeg- hosts: servers
roles:
- role: kovalevsky.ffmpeg
ffmpeg_compile_codecs: true- hosts: servers
roles:
- role: kovalevsky.ffmpeg
ffmpeg_role_action: uninstall
ffmpeg_remove_deps: trueThis role uses Molecule for testing:
# Install dependencies
pip install molecule molecule-docker ansible-lint
# Run tests
molecule test- Ubuntu 20.04 (Focal)
- Ubuntu 22.04 (Jammy)
- Ubuntu 24.04 (Noble)
- Debian 11 (Bullseye)
- Debian 12 (Bookworm)
BSD-3-Clause
Sergey Kovalevsky / HttpLab