{"id":13905495,"url":"https://github.com/AkashiSN/ffmpeg-docker","last_synced_at":"2025-07-18T02:33:36.604Z","repository":{"id":42664457,"uuid":"359882662","full_name":"AkashiSN/ffmpeg-docker","owner":"AkashiSN","description":"ffmpeg build in docker","archived":false,"fork":false,"pushed_at":"2024-09-15T13:14:10.000Z","size":185,"stargazers_count":32,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-16T14:04:46.644Z","etag":null,"topics":["aribb24","crossbuild","cuda","docker","ffmpeg","intel-qsv","mingw64","vaapi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AkashiSN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-20T16:30:07.000Z","updated_at":"2024-09-15T13:14:14.000Z","dependencies_parsed_at":"2024-09-15T14:10:59.073Z","dependency_job_id":null,"html_url":"https://github.com/AkashiSN/ffmpeg-docker","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashiSN%2Fffmpeg-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashiSN%2Fffmpeg-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashiSN%2Fffmpeg-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashiSN%2Fffmpeg-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkashiSN","download_url":"https://codeload.github.com/AkashiSN/ffmpeg-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226336539,"owners_count":17608857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aribb24","crossbuild","cuda","docker","ffmpeg","intel-qsv","mingw64","vaapi"],"created_at":"2024-08-06T23:01:17.066Z","updated_at":"2024-11-25T13:31:18.993Z","avatar_url":"https://github.com/AkashiSN.png","language":"Shell","readme":"# ffmpeg-docker\n\n[![ffmpeg](https://github.com/AkashiSN/ffmpeg-docker/actions/workflows/ffmpeg.yml/badge.svg)](https://github.com/AkashiSN/ffmpeg-docker/actions/workflows/ffmpeg.yml)\n\n[![](https://dockeri.co/image/akashisn/ffmpeg)](https://hub.docker.com/r/akashisn/ffmpeg)\n\n## Available release\n\n- Linux docker image (`akashisn/ffmpeg`) \u0026 binary release\n  - `7.0.2`\n  - `6.1.2`\n  - `5.1.6`\n  - `4.4.5`\n- Windows binary release\n  - `7.0.2`\n  - `6.1.2`\n  - `5.1.6`\n  - `4.4.5`\n\n## Supported architecture\n\n- ffmpeg\n  - `linux/amd64`\n\n    \u003cdetails\u003e\n    \u003csummary\u003econfigure options:\u003c/summary\u003e\n\n    ```bash\n    --enable-zlib --enable-lzma --enable-gmp --enable-iconv --enable-gnutls --enable-libsrt\n    --enable-libopenjpeg --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265\n    --enable-libaom --enable-libvmaf --enable-libopus --enable-libvorbis --enable-libopencore-amrnb\n    --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libmp3lame --enable-libfreetype\n    --enable-libfribidi --enable-libxml2 --enable-libfontconfig --enable-libass --enable-libaribb24\n    --enable-sdl2 --enable-cuda-llvm --enable-ffnvcodec --enable-cuvid --enable-nvdec --enable-nvenc\n    --enable-libdrm --enable-vaapi --enable-libvpl --disable-autodetect --disable-debug --disable-doc\n    --enable-gpl --enable-version3 --extra-libs='-lm -lpthread -lstdc++' --pkg-config-flags=--static\n    --prefix=/usr/local\n    ```\n    \u003c/details\u003e\n\n    \u003cdetails\u003e\n    \u003csummary\u003eDependent library\u003c/summary\u003e\n\n    ```bash\n    $ ldd ffmpeg\n        linux-vdso.so.1 (0x00007ffed66ba000)\n        libm.so.6 =\u003e /lib/x86_64-linux-gnu/libm.so.6 (0x00007f38fcc95000)\n        libstdc++.so.6 =\u003e /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f38fca69000)\n        libc.so.6 =\u003e /lib/x86_64-linux-gnu/libc.so.6 (0x00007f38fc841000)\n        /lib64/ld-linux-x86-64.so.2 (0x00007f3901805000)\n        libmvec.so.1 =\u003e /lib/x86_64-linux-gnu/libmvec.so.1 (0x00007f38fc744000)\n        libgcc_s.so.1 =\u003e /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f38fc724000)\n    ```\n    \u003c/details\u003e\n\n- Windows ffmpeg\n  - `windows/x64`\n    \u003cdetails\u003e\n    \u003csummary\u003econfigure options:\u003c/summary\u003e\n\n    ```bash\n    --enable-zlib --enable-libopenjpeg --enable-libwebp --enable-lzma --enable-gmp --enable-iconv\n    --enable-gnutls --enable-libsrt --enable-libvpx --enable-libx264 --enable-libx265 --enable-libaom\n    --enable-libopus --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb\n    --enable-libvo-amrwbenc --enable-libmp3lame --enable-libfreetype --enable-libfribidi --enable-libxml2\n    --enable-libfontconfig --enable-libass --enable-libaribb24 --enable-sdl2 --enable-cuda-llvm\n    --enable-ffnvcodec --enable-cuvid --enable-nvdec --enable-nvenc --enable-libmfx --enable-d3d11va\n    --enable-dxva2 --arch=x86_64 --cross-prefix=x86_64-w64-mingw32- --disable-autodetect --disable-debug\n    --disable-doc --disable-w32threads --enable-cross-compile --enable-gpl --enable-version3\n    --extra-libs='-static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lpthread -lstdc++'\n    --extra-cflags=--static --target-os=mingw64 --pkg-config=pkg-config --pkg-config-flags=--static -prefix=/usr/local\n    ```\n    \u003c/details\u003e\n\n    \u003cdetails\u003e\n    \u003csummary\u003eDependent library\u003c/summary\u003e\n\n    ```bash\n    $ LANG=C objdump -p ffmpeg.exe | grep 'DLL Name:'\n      DLL Name: ADVAPI32.dll\n      DLL Name: bcrypt.dll\n      DLL Name: GDI32.dll\n      DLL Name: KERNEL32.dll\n      DLL Name: msvcrt.dll\n      DLL Name: ole32.dll\n      DLL Name: OLEAUT32.dll\n      DLL Name: PSAPI.DLL\n      DLL Name: SHELL32.dll\n      DLL Name: SHLWAPI.dll\n      DLL Name: USER32.dll\n      DLL Name: AVICAP32.dll\n      DLL Name: WS2_32.dll\n    ```\n    \u003c/details\u003e\n\n## HWaccels\n\nhttps://trac.ffmpeg.org/wiki/HWAccelIntro\n\n```bash\n$ ffmpeg -hide_banner -hwaccels\nHardware acceleration methods:\ncuda\nvaapi\nqsv\ndrm\n```\n\n- `cuda`: NVIDIA's GPU accelerated video codecs (`nvenc/nvdec`)\n  ```bash\n  $ ffmpeg -hide_banner -encoders | grep nvenc\n    V....D av1_nvenc            NVIDIA NVENC av1 encoder (codec av1)\n    V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)\n    V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)\n  ```\n- `vaapi`: Intel Media Driver for VAAPI\n  ```bash\n  $ ffmpeg -hide_banner -encoders | grep vaapi\n    V....D h264_vaapi           H.264/AVC (VAAPI) (codec h264)\n    V....D hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)\n    V....D mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)\n    V....D mpeg2_vaapi          MPEG-2 (VAAPI) (codec mpeg2video)\n    V....D vp8_vaapi            VP8 (VAAPI) (codec vp8)\n    V....D vp9_vaapi            VP9 (VAAPI) (codec vp9)\n  ```\n\n- `QSV`: Intel QSV (Intel Quick Sync Video)\n  ```bash\n  $ ffmpeg -hide_banner -encoders | grep qsv\n    V..... av1_qsv              AV1 (Intel Quick Sync Video acceleration) (codec av1)\n    V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)\n    V..... hevc_qsv             HEVC (Intel Quick Sync Video acceleration) (codec hevc)\n    V..... mjpeg_qsv            MJPEG (Intel Quick Sync Video acceleration) (codec mjpeg)\n    V..... mpeg2_qsv            MPEG-2 video (Intel Quick Sync Video acceleration) (codec mpeg2video)\n    V..... vp9_qsv              VP9 video (Intel Quick Sync Video acceleration) (codec vp9)\n  ```\n\n\n## Intel QSV (Intel Quick Sync Video)\n\nhttps://trac.ffmpeg.org/wiki/Hardware/QuickSync\n\nYou can use the following command to find out which codecs are supported by your CPU.\n\n```bash\n$ sudo docker run --rm -it --device=/dev/dri akashisn/vainfo\nTrying display: drm\nlibva info: VA-API version 1.19.0\nlibva info: User environment variable requested driver 'iHD'\nlibva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so\nlibva info: Found init function __vaDriverInit_1_19\nlibva info: va_openDriver() returns 0\nvainfo: VA-API version: 1.19 (libva 2.19.0)\nvainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.3.3 (1c13afa)\nvainfo: Supported profile and entrypoints\n      VAProfileNone                   : VAEntrypointVideoProc\n      VAProfileNone                   : VAEntrypointStats\n      VAProfileMPEG2Simple            : VAEntrypointVLD\n      VAProfileMPEG2Simple            : VAEntrypointEncSlice\n      VAProfileMPEG2Main              : VAEntrypointVLD\n      VAProfileMPEG2Main              : VAEntrypointEncSlice\n      VAProfileH264Main               : VAEntrypointVLD\n      VAProfileH264Main               : VAEntrypointEncSlice\n      VAProfileH264Main               : VAEntrypointFEI\n      VAProfileH264Main               : VAEntrypointEncSliceLP\n      VAProfileH264High               : VAEntrypointVLD\n      VAProfileH264High               : VAEntrypointEncSlice\n      VAProfileH264High               : VAEntrypointFEI\n      VAProfileH264High               : VAEntrypointEncSliceLP\n      VAProfileVC1Simple              : VAEntrypointVLD\n      VAProfileVC1Main                : VAEntrypointVLD\n      VAProfileVC1Advanced            : VAEntrypointVLD\n      VAProfileJPEGBaseline           : VAEntrypointVLD\n      VAProfileJPEGBaseline           : VAEntrypointEncPicture\n      VAProfileH264ConstrainedBaseline: VAEntrypointVLD\n      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice\n      VAProfileH264ConstrainedBaseline: VAEntrypointFEI\n      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP\n      VAProfileVP8Version0_3          : VAEntrypointVLD\n      VAProfileVP8Version0_3          : VAEntrypointEncSlice\n      VAProfileHEVCMain               : VAEntrypointVLD\n      VAProfileHEVCMain               : VAEntrypointEncSlice\n      VAProfileHEVCMain               : VAEntrypointFEI\n      VAProfileHEVCMain10             : VAEntrypointVLD\n      VAProfileHEVCMain10             : VAEntrypointEncSlice\n      VAProfileVP9Profile0            : VAEntrypointVLD\n      VAProfileVP9Profile2            : VAEntrypointVLD\n```\n\n- `VAEntrypointEncSlice`: Can encode\n- `VAEntrypointVLD` : Can decode\n\n\n## Binary release\n\nYou can find the pre-built binary files on the [release page](https://github.com/AkashiSN/ffmpeg-docker/releases).\n\nThere are files in the assets with the following naming conventions:\n\n```\nffmpeg-${version}-${\"linux\" or \"windows\"}-${arch}.tar.gz\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eContains of archive file:\u003c/summary\u003e\n\n```bash\n$ ls\nbin  configure_options  lib  run.sh\n\n$ ls bin/\nffmpeg  ffplay  ffprobe\n\n$ tree lib/\nlib\n├── dri\n│   ├── i965_drv_video.so\n│   └── iHD_drv_video.so\n├── libdrm.so -\u003e libdrm.so.2\n├── libdrm.so.2 -\u003e libdrm.so.2.123.0\n├── libdrm.so.2.123.0\n├── libdrm_amdgpu.so -\u003e libdrm_amdgpu.so.1\n├── libdrm_amdgpu.so.1 -\u003e libdrm_amdgpu.so.1.123.0\n├── libdrm_amdgpu.so.1.123.0\n├── libdrm_intel.so -\u003e libdrm_intel.so.1\n├── libdrm_intel.so.1 -\u003e libdrm_intel.so.1.123.0\n├── libdrm_intel.so.1.123.0\n├── libdrm_nouveau.so -\u003e libdrm_nouveau.so.2\n├── libdrm_nouveau.so.2 -\u003e libdrm_nouveau.so.2.123.0\n├── libdrm_nouveau.so.2.123.0\n├── libdrm_radeon.so -\u003e libdrm_radeon.so.1\n├── libdrm_radeon.so.1 -\u003e libdrm_radeon.so.1.123.0\n├── libdrm_radeon.so.1.123.0\n├── libigdgmm.so -\u003e libigdgmm.so.12\n├── libigdgmm.so.12 -\u003e libigdgmm.so.12.5.0\n├── libigdgmm.so.12.5.0\n├── libigfxcmrt.so -\u003e libigfxcmrt.so.7\n├── libigfxcmrt.so.7 -\u003e libigfxcmrt.so.7.2.0\n├── libigfxcmrt.so.7.2.0\n├── libmfx-gen\n│   └── enctools.so\n├── libmfx-gen.so -\u003e libmfx-gen.so.1.2\n├── libmfx-gen.so.1.2 -\u003e libmfx-gen.so.1.2.12\n├── libmfx-gen.so.1.2.12\n├── libmfx.so -\u003e libmfx.so.1\n├── libmfx.so.1 -\u003e libmfx.so.1.35\n├── libmfx.so.1.35\n├── libmfxhw64.so -\u003e libmfxhw64.so.1\n├── libmfxhw64.so.1 -\u003e libmfxhw64.so.1.35\n├── libmfxhw64.so.1.35\n├── libpciaccess.so -\u003e libpciaccess.so.0\n├── libpciaccess.so.0 -\u003e libpciaccess.so.0.11.1\n├── libpciaccess.so.0.11.1\n├── libva-drm.so -\u003e libva-drm.so.2.2200.0\n├── libva-drm.so.2 -\u003e libva-drm.so.2.2200.0\n├── libva-drm.so.2.2200.0\n├── libva.so -\u003e libva.so.2.2200.0\n├── libva.so.2 -\u003e libva.so.2.2200.0\n├── libva.so.2.2200.0\n└── mfx\n    ├── libmfx_h264la_hw64.so\n    ├── libmfx_hevc_fei_hw64.so\n    ├── libmfx_hevcd_hw64.so\n    ├── libmfx_hevce_hw64.so\n    ├── libmfx_vp8d_hw64.so\n    ├── libmfx_vp9d_hw64.so\n    └── libmfx_vp9e_hw64.so\n\n3 directories, 49 files\n\n$ cat run.sh\n#!/bin/sh\nexport PATH=$(dirname $0)/bin:$PATH\nexport LD_LIBRARY_PATH=$(dirname $0)/lib:$LD_LIBRARY_PATH\nexport LIBVA_DRIVERS_PATH=$(dirname $0)/lib/dri\nexport LIBVA_DRIVER_NAME=iHD\nexec $@\n```\n\u003c/details\u003e\n\nIf you use `run.sh`, you can run it after setting the `LD_LIBRARY_PATH` and other settings.\n\nAnd, if you want to encode with QSV, you need to run it with root privileges.\n\nsample:\n\n```bash\n$ sudo ./run.sh ffmpeg -y \\\n    -init_hw_device qsv:hw \\\n    -hwaccel qsv \\\n    -hwaccel_output_format qsv \\\n    -extra_hw_frames 32 \\\n    -i https://github.com/bower-media-samples/big-buck-bunny-1080p-60fps-30s/raw/master/video.mp4 \\\n    -c:v h264_qsv \\\n    -f mp4 \\\n    video-h264_qsv.mp4\n```\n\n## Docker image release\n\nWhen running in Docker, you need to mount the DRI device.\n\nsample:\n```bash\n$ sudo docker run --rm -it --device=/dev/dri -v `pwd`:/workdir \\\n    akashisn/ffmpeg:7.0.2 -y \\\n      -loglevel verbose \\\n      -init_hw_device qsv:hw \\\n      -hwaccel qsv \\\n      -hwaccel_output_format qsv \\\n      -extra_hw_frames 32 \\\n      -i video.mp4 \\\n      -c:v h264_qsv \\\n      -f mp4 \\\n      video-h264_qsv.mp4\n```\n\n# Nonfree codecs\n\nIf you want to use a non-free codec(e.g. `fdk-aac`, `libnpp` ), you can generate a binary in the current directory by executing the following command.\n\n**Generated binaries cannot be redistributed due to licensing issues. Please use them for your own use only.**\n\n```powershell\n# for windows build\n\u003e $Env:CUDA_SDK_VERSION = \"12.0.1\"\n\u003e $Env:NVIDIA_DRIVER_VERSION = \"528.33\"\n\u003e curl -L -o cuda_${Env:CUDA_SDK_VERSION}_${Env:NVIDIA_DRIVER_VERSION}_windows.exe https://developer.download.nvidia.com/compute/cuda/${Env:CUDA_SDK_VERSION}/local_installers/cuda_${Env:CUDA_SDK_VERSION}_${Env:NVIDIA_DRIVER_VERSION}_windows.exe\n\u003e docker buildx build --build-arg HOST_TARGET=x86_64-w64-mingw32 --build-arg TARGET_OS=windows --build-arg CUDA_SDK_VERSION=${Env:CUDA_SDK_VERSION} --build-arg NVIDIA_DRIVER_VERSION=${Env:NVIDIA_DRIVER_VERSION} --output type=local,dest=build -t ffmpeg-nonfree:windows -f ./nonfree.Dockerfile .\n```\n\n```bash\n# for linux build\n$ touch cuda_11.6.0_511.23_windows.exe # dummy file\n$ docker buildx build --output type=local,dest=build -t ffmpeg-nonfree:linux -f ./nonfree.Dockerfile .\n```\n\n# Technical information\n\n## Intel Quick Sync Video\n\nQSV (Quick Sync Video) was previously supported by `libmfx.so` provided by MediaSDK, but since the development of MediaSDK has been discontinued, it has been taken over by the successor, oneAPI's oneVPL (`libvpl.so`).\nIn FFmpeg, the option `--enable-libvpl` was added from version 6.0. Therefore, in this build, only version `6.0` supports QSV through oneVPL's dispatcher, and previous versions are built using the old MediaSDK dispatcher.\nNote that the MediaSDK may no longer be usable as it lacks support for new hardware.\nMoreover, oneVPL supports older hardware by calling `MediaSDK`.\nTherefore, unless there is a reason to use an older version of FFmpeg, it is recommended to use the version compatible with oneVPL.\n\n```mermaid\ngraph TD;\n    VPL[oneVPL Dispatcher]--\u003eoneVPL-intel-gpu;\n    VPL[oneVPL Dispatcher]--\u003eMediaSDK;\n```\n\nhttps://github.com/oneapi-src/oneVPL/tree/master#onevpl-architecture\n\n### QSV in VM\n\nTo execute QSV (Quick Sync Video) on a Virtual Machine, it is necessary to pass through Intel's integrated GPU (iGPU) to the VM.\nPass-through technologies include Intel GVT-g, SR-IOV, etc., and the compatibility varies depending on the generation of the CPU[^1].\nFor Intel GVT-g, please refer to the ArchWiki[^2].\nIn Proxmox, if you are using systemd-boot instead of GRUB, kernel parameters can be set using `/etc/kernel/cmdline`. Also, don't forget to apply the changes by running `proxmox-boot-tool refresh`. If necessary, adding `kvm.ignore_msrs=1` is recommended[^3].\n\n[^1]: [Graphics Virtualization Technologies Support for Each Intel® Graphics Family](https://www.intel.com/content/www/us/en/support/articles/000093216/graphics/processor-graphics.html)\n\n[^2]:https://wiki.archlinux.org/title/Intel_GVT-g\n\n[^3]:https://kagasu.hatenablog.com/entry/2021/01/29/111659\n\n## Dynamic Library\n\nUsing [https://github.com/yugr/Implib.so](https://github.com/yugr/Implib.so), the dynamic library related to QSV is delay-loaded, so when you run `ldd` to check, it appears to have no dependencies. However, please note that it becomes necessary when using QSV. This resolves the inconvenience where FFmpeg wouldn't even start without the dynamic library even when QSV is not needed, achieving a pseudo-static link. Therefore, we have consolidated the tags which were previously separated based on whether QSV was available or not.\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAkashiSN%2Fffmpeg-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAkashiSN%2Fffmpeg-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAkashiSN%2Fffmpeg-docker/lists"}