
migoller/ffmpegMinimalistic Docker image with FFmpeg and support for hardware acceleration based on archlinux.
You can install the latest build of this image by running docker pull migoller/ffmpeg.
This image can be used as a base for an encoding farm or for Shinobi CCTV hardware accelerated Docker images. The image is scheduled for weekly builds on every Sunday.
Please use GitLab issues to report any bug or missing feature.
Feel free to contribute on my GitLab FFmpeg Docker image repository.
Let's encode a rtsp stream into an MP4 out_nohwaccel.mp4 is located in the current directory.
$ docker run -it -rm -v $PWD:/tmp \ migoller/ffmpeg \ -loglevel info -stats \ -i rtsp://<rtsp url> \ -vf 'scale=640:480' \ -preset ultrafast \ -c:v libx264 \ -t 20 -r 8 -f mp4 /tmp/out_nohwaccel.mp4
Now let's encode a rtsp stream into an MP4 out_hwaccel.mp4 is located in the current directory with VA-API hardware acceleration of an Intel i965 compatible CPU with Intel HD GPU.
$ docker run -it -rm --device /dev/dri:/dev/dri -v $PWD:/tmp -e LIBVA_DRIVER_NAME="i965" \ migoller/ffmpeg \ -loglevel info -stats \ -i rtsp://<rtsp url> \ -vaapi_device /dev/dri/renderD128 \ -vf 'hwupload,scale_vaapi=w=640:h=480:format=nv12' \ -preset ultrafast \ -c:v h264_vaapi \ -t 20 -r 8 -f mp4 /tmp/out_hwaccel.mp4
Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power:
Please have a look at archlinux Hardware video acceleration for further details.
intel-media-driver.libva-intel-driver.libva-mesa-driver and mesa-vdpau.nvidia-utils:mesa-vdpau.libva-mesa-driver.libva-vdpau-driver – VDPAU backend for VA-API.libvdpau-va-gl – VA-API backend for VDPAU, only H.264 support.To use the hardware acceleration features you have to configure your Docker host and the container to match the required drivers.
Have your GPUs´ drivers up and running on your host.
Ensure that your graphics card has been recognized correctly running vainfo, vdpauinfo or nvidia-utils.
Run vainfo to check that your GPU is recognized correctly.
$ vainfo error: XDG_RUNTIME_DIR not set in the environment. error: can't connect to X server! libva info: VA-API version 0.39.4 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_0_39 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.39 (libva 1.7.3) vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.0 vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointEncSlice VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice
Run vdpauinfo to check that your GPU is recognized correctly.
$ vdpauinfo display: :0 screen: 0 API version: 1 Information string: G3DVL VDPAU Driver Shared Library version 1.0 Video surface: name width height types 420 *** *** NV12 YV12 422 *** *** UYVY YUYV 444 *** *** Y8U8V8A8 V8U8Y8A8 Decoder capabilities: name level macbs width height MPEG1 --- not supported --- MPEG2_SIMPLE 3 9216 2048 1152 MPEG2_MAIN 3 9216 2048 1152 H264_BASELINE 41 9216 2048 1152 H264_MAIN 41 9216 2048 1152 H264_HIGH 41 9216 2048 1152 VC1_SIMPLE 1 9216 2048 1152 VC1_MAIN 2 9216 2048 1152 VC1_ADVANCED 4 9216 2048 1152
Run the container with the device attached /dev/dri from your Docker host into the container and set the environment accordingly to the GPU driver.
$ docker run --device /dev/dri:/dev/dri -e LIBVA_DRIVER_NAME="i965" [...] migoller/ffmpeg [...]`
Run the FFmpeg container with the correct parameters like running ffmpeg natively.
You can override the driver for VA-API by using the LIBVA_DRIVER_NAME environment variable; the default value is set to i965. The correct driver name depends on your setup.
Intel graphics:
libva-intel-driver set to i965.intel-media-driver set to iHD.NVIDIA:
nouveau.vdpau.ATI/AMD:
radeonsi.You need to set VDPAU_DRIVER environment variable to point to correct driver. The correct driver name depends on your setup.
Intel graphics:
va_gl.NVIDIA:
nouveau.nvidia.ATI/AMD:
vdpauinfo to determine the driver version of your GPU.


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务