Skip to content

outlyer-net/docker-ffmpeg-nonfree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image Size (latest by date) Docker Cloud Build Status GitHub last commit MIT License

FFmpeg non-free in Docker

A dockerized FFmpeg compiled with non-free codecs in.
A script for easy invocation is included.

For Linux distributions where the included FFmpeg package isn't compiled with non-free codecs included.

This image pulls Deb Multimedia's ffmpeg package, which includes codecs such as Fraunhofer FDK AAC (aka libfdk_aac, the highest-quality AAC encoder in FFmpeg as of this writing), missing from most compilations.

Wrapper script installation

You can install and uninstall a wrapper script with the included makefile for easy access to the image's ffmpeg.
Running the script will pull the image if required.

$ sudo make install
$ ffmpeg-nonfree-docker [...]

You may additionally install symbolic links without the -nonfree-docker suffix:

$ sudo make install-shortnames
$ ffmpeg [...]

You may uninstall it with sudo make uninstall.

NOTE: The script will mount the host's filesystem as /host and run from the invoking directory. Additionally /home will also be mounted as simply /home.
Referencing files with relative paths should work without any extra parameter whereas absolute paths should be prepended by /host unless they're under /home.

$ ffmpeg-nonfree-docker -i input_file               # Access ./input_file from the host
$ ffmpeg-nonfree-docker -i ../input_file            # Access ../input_file from the host
$ ffmpeg-nonfree-docker -i /home/user/input_file    # Access /home/user/input_file from the host
$ ffmpeg-nonfree-docker -i /host/path/to/input_file # Access /path/to/input_file from the host

A comparison of included codecs

Note the included makefile eases such comparisons (for a selection of codecs).
For each distribution with a corresponding Dockerfile in the downstream/ directory you can get run:

$ make build-$distro compare-codecs-$distro

e.g.:

$ make build-debian compare-codecs-debian

Here's an excerpt of some important codecs (I'm only including differences):

Codec Encoder this image Debian Ubuntu LTS Ubuntu Alpine Fedora
h.264
h264_amf yes no no no no yes
h264_nvenc yes no yes yes no yes
h264_omx yes yes yes yes no no
h264_qsv yes yes yes yes no yes
libopenh264 yes no no no no no
nvenc no no yes yes no no
nvenc_h264 no no yes yes no no
HEVC
hevc_amf yes no no no no yes
hevc_nvenc yes  no yes yes no yes
hevc_qsv yes  yes yes yes no yes
libkvazaar yes  no no no no no
nvenc_hevc no no yes yes no no
MJPEG
mjpeg_qsv yes yes yes yes no yes
MPEG-2
mpeg2_qsv  yes yes yes no no yes
AAC
   libfdk_aac yes no no no no no

Versions:

$ make pull-distros # pull the latest images
[...]
$ make versions
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
alpine:
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
debian:
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
fedora:
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
ubuntu:
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
ubuntu-lts:
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers

Links