{"id":13643372,"url":"https://github.com/wader/static-ffmpeg","last_synced_at":"2025-10-05T13:40:12.926Z","repository":{"id":37622745,"uuid":"129968573","full_name":"wader/static-ffmpeg","owner":"wader","description":"Multi-arch docker image with ffmpeg/ffprobe binaries built as hardened static PIE binaries with no external dependencies","archived":false,"fork":false,"pushed_at":"2025-10-01T17:18:52.000Z","size":853,"stargazers_count":339,"open_issues_count":33,"forks_count":76,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-01T19:18:00.566Z","etag":null,"topics":["amd64","arm64","aslr","docker","ffmpeg","ffprobe","hardened","static-binary"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/mwader/static-ffmpeg/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wader.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-17T21:42:39.000Z","updated_at":"2025-10-01T17:18:56.000Z","dependencies_parsed_at":"2023-09-29T17:36:09.678Z","dependency_job_id":"9447ca76-fee9-43e1-aa8e-28d8f31cbb75","html_url":"https://github.com/wader/static-ffmpeg","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/wader/static-ffmpeg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Fstatic-ffmpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Fstatic-ffmpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Fstatic-ffmpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Fstatic-ffmpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wader","download_url":"https://codeload.github.com/wader/static-ffmpeg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wader%2Fstatic-ffmpeg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278464314,"owners_count":25991176,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["amd64","arm64","aslr","docker","ffmpeg","ffprobe","hardened","static-binary"],"created_at":"2024-08-02T01:01:46.537Z","updated_at":"2025-10-05T13:40:12.921Z","avatar_url":"https://github.com/wader.png","language":"Dockerfile","funding_links":[],"categories":["HarmonyOS","Dockerfile"],"sub_categories":["Windows Manager"],"readme":"## static-ffmpeg\n\nDocker image with\n[ffmpeg](https://ffmpeg.org/ffmpeg.html) and\n[ffprobe](https://ffmpeg.org/ffprobe.html)\nbuilt as hardened static PIE binaries with no external dependencies that can be\nused with any base image.\n\nSee [Dockerfile](Dockerfile) for versions used. In general, master **should** have the\nlatest stable version of ffmpeg and below libraries.\nVersions are kept up to date automatically using [bump](https://github.com/wader/bump).\n\n### Usage\n\nUse `mwader/static-ffmpeg` from [Docker Hub](https://hub.docker.com/r/mwader/static-ffmpeg) or build the image yourself.\n\nIn Dockerfile\n```Dockerfile\nCOPY --from=mwader/static-ffmpeg:8.0 /ffmpeg /usr/local/bin/\nCOPY --from=mwader/static-ffmpeg:8.0 /ffprobe /usr/local/bin/\n```\n\nRun directly\n```sh\ndocker run -i --rm -u $UID:$GROUPS -v \"$PWD:$PWD\" -w \"$PWD\" mwader/static-ffmpeg:8.0 -i file.wav file.mp3\ndocker run -i --rm -u $UID:$GROUPS -v \"$PWD:$PWD\" -w \"$PWD\" --entrypoint=/ffprobe mwader/static-ffmpeg:8.0 -i file.wav\n```\n\nAs shell alias\n```sh\nalias ffmpeg='docker run -i --rm -u $UID:$GROUPS -v \"$PWD:$PWD\" -w \"$PWD\" mwader/static-ffmpeg:8.0'\nalias ffprobe='docker run -i --rm -u $UID:$GROUPS -v \"$PWD:$PWD\" -w \"$PWD\" --entrypoint=/ffprobe mwader/static-ffmpeg:8.0'\n```\n\n### Libraries\n\n- [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/)\n- gray (full grayscale support)\n- iconv (from musl)\n- [lcms2](https://www.littlecms.com/)\n- [libaom](https://aomedia.googlesource.com/aom/)\n- [libaribb24](https://github.com/nkoriyama/aribb24)\n- [libass](https://github.com/libass/libass)\n- [libbluray](https://www.videolan.org/developers/libbluray.html)\n- [libdav1d](https://code.videolan.org/videolan/dav1d)\n- [libdavs2](https://github.com/pkuvcl/davs2)\n- [libfdk-aac](https://github.com/mstorsjo/fdk-aac) (only if explicitly enabled during build, [see below](#libfdk-aac))\n- [libfreetype](https://freetype.org/)\n- [libfribidi](https://github.com/fribidi/fribidi)\n- [libgme](https://github.com/mcfiredrill/libgme)\n- [libgsm](https://github.com/timothytylee/libgsm)\n- [libharfbuzz](https://github.com/harfbuzz/harfbuzz)\n- [libjxl](https://github.com/libjxl/libjxl)\n- [libkvazaar](https://github.com/ultravideo/kvazaar)\n- [libmodplug](https://github.com/Konstanty/libmodplug)\n- [libmp3lame](https://lame.sourceforge.io/)\n- [libmysofa](https://github.com/hoene/libmysofa)\n- [libopencore](https://sourceforge.net/projects/opencore-amr/)\n- [libopenjpeg](https://www.openjpeg.org)\n- [libopus](https://opus-codec.org)\n- [librabbitmq](https://github.com/alanxz/rabbitmq-c)\n- [librav1e](https://github.com/xiph/rav1e)\n- [librsvg](https://gitlab.gnome.org/GNOME/librsvg)\n- [librtmp](https://rtmpdump.mplayerhq.hu/)\n- [librubberband](https://breakfastquay.com/rubberband/)\n- [libshine](https://github.com/toots/shine)\n- [libsnappy](https://google.github.io/snappy/)\n- [libsoxr](https://sourceforge.net/projects/soxr/)\n- [libspeex](https://github.com/xiph/speex)\n- [libsrt](https://github.com/Haivision/srt)\n- [libssh](https://gitlab.com/libssh/libssh-mirror)\n- [libsvtav1](https://gitlab.com/AOMediaCodec/SVT-AV1)\n- [libtheora](https://github.com/xiph/theora)\n- [libtwolame](https://github.com/njh/twolame)\n- [libuavs3d](https://github.com/uavs3/uavs3d)\n- [libva](https://github.com/intel/libva)\n- [libvidstab](https://github.com/georgmartius/vid.stab)\n- [libvmaf](https://github.com/Netflix/vmaf)\n- [libvo-amrwbenc](https://github.com/mstorsjo/vo-amrwbenc)\n- [libvorbis](https://github.com/xiph/vorbis)\n- [libvpl](https://github.com/intel/libvpl)\n- [libvpx](https://github.com/webmproject/libvpx)\n- [libvvenc](https://github.com/fraunhoferhhi/vvenc)\n- [libwebp](https://chromium.googlesource.com/webm/libwebp)\n- [libx264](https://www.videolan.org/developers/x264.html)\n- [libx265](https://www.videolan.org/developers/x265.html) (multilib with support for 10 and 12 bits)\n- [libxavs2](https://github.com/pkuvcl/xavs2)\n- [libxevd](https://github.com/mpeg5/xevd)\n- [libxeve](https://github.com/mpeg5/xeve)\n- [libxml2](https://gitlab.gnome.org/GNOME/libxml2)\n- [libxvid](https://labs.xvid.com)\n- [libzimg](https://github.com/sekrit-twc/zimg)\n- [libzmq](https://github.com/zeromq/libzmq)\n- [openssl](https://openssl.org)\n- and all native ffmpeg codecs, formats, filters etc.\n\n### Files in the image\n\n- `/ffmpeg` ffmpeg binary\n- `/ffprobe` ffprobe binary\n- `/doc` Documentation\n- `/versions.json` JSON file with build versions of ffmpeg and libraries.\n- `/etc/ssl/cert.pem` CA certs to make `-tls_verify 1 -ca_file /etc/ssl/cert.pem` work if running image directly\n- Fonts, fontconfig config and pre-populated cache:\n  - `/etc/fonts`\n  - `/usr/share/fonts`\n  - `/usr/share/consolefonts`\n  - `/var/cache/fontconfig`\n\n### Tags\n\n`latest` Latest master build.\n\n`MAJOR.MINOR.PATCH[-BUILD]` Specific version of FFmpeg with the features that was in master at the time of tagging.\n`-BUILD` means that was an additional build with that version to add of fix something.\n\n### Security\n\nBinaries are built with various hardening features but it's *still a good idea to run them\nas non-root even when used inside a container*, especially so if running on input files that\nyou don't control.\n\n### libfdk-aac\nDue to license issues the docker image does not include libfdk-aac by default. A docker image including libfdk-aac can be built by passing a non empty value to the build-arg `ENABLE_FDKAAC`, example below.\n```\ndocker build --build-arg ENABLE_FDKAAC=1 . -t my-ffmpeg-static:latest\n```\n\n### Fonts usage with SVG or draw text filters etc\n\nThe image ships with some basic fonts (`font-terminus font-inconsolata font-dejavu font-awesome`) that can be used when running the image directly. If your copying the binaries into some image you have to install fonts somehow. How to do this depends a bit on distributions but in general look for font packages and how to make [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) know about them.\n\n- Alpine Linux see https://wiki.alpinelinux.org/wiki/Fonts\n- Debian/Ubuntu see https://wiki.debian.org/Fonts\n\n#### Custom fonts directory\n\nLet's say you're building a docker image for your application that requires the `ffmpeg` and `ffprobe` binaries, and want to have a dedicated directory for storing fonts, e.g. `/app/fonts`. In order to achieve this, let's take a look at the following steps.\n\n1. A custom config file containing the fonts directory you want to use has to be added to the image. Here, a file `50-custom.conf` will be added to the `/etc/fonts/conf.d` directory, containing an additional `/app/fonts` directory for Fontconfig to use.\n\n```Dockerfile\nCOPY \u003c\u003cEOF /etc/fonts/conf.d/50-custom.conf\n\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE fontconfig SYSTEM \"urn:fontconfig:fonts.dtd\"\u003e\n\u003cfontconfig\u003e\n        \u003cdir\u003e/app/fonts\u003c/dir\u003e\n\u003c/fontconfig\u003e\nEOF\n```\n\n\u003e [!TIP]\n\u003e Check the [Fontconfig User Documentation](https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user.html) for examples and available options for your custom fontconfig file.\n\n2. Copy the `ffmpeg` (and `ffprobe`) binaries.\n\n```Dockerfile\nCOPY --from=mwader/static-ffmpeg:8.0 /ffmpeg /usr/bin/\nCOPY --from=mwader/static-ffmpeg:8.0 /ffprobe /usr/bin/\n```\n\n3. Make sure the `/app/fonts` directory exist in your image.\n\n```Dockerfile\nWORKDIR /app\n\nRUN \u003c\u003cEOT bash\n  set -ex\n  mkdir -p ./fonts\nEOT\n```\n\nIf you followed the steps above, your image should look something like this.\n\n```Dockerfile\nFROM python:3.11-slim-bookworm AS base\n\nCOPY \u003c\u003cEOF /etc/fonts/conf.d/50-custom.conf\n\u003c?xml version=\"1.0\"?\u003e\n\u003c!DOCTYPE fontconfig SYSTEM \"urn:fontconfig:fonts.dtd\"\u003e\n\u003cfontconfig\u003e\n        \u003cdir\u003e/app/fonts\u003c/dir\u003e\n\u003c/fontconfig\u003e\nEOF\n\nFROM base as ffmpeg\n\nCOPY --from=mwader/static-ffmpeg:8.0 /ffmpeg /usr/bin/\nCOPY --from=mwader/static-ffmpeg:8.0 /ffprobe /usr/bin/\n\nFROM ffmpeg AS app\n\nWORKDIR /app\n\nRUN \u003c\u003cEOT bash\n  set -ex\n  mkdir -p ./fonts\nEOT\n```\n\nYou can now build the image and run a container that has volume mounted to `/app/fonts`.\n\n```shell\ndocker build -t ffmpeg-fonts-image .\ndocker run -i --rm \\\n  -u \"$UID:$GROUPS\" \\\n  -v \"$PWD:$PWD\" \\\n  -v \"$PWD/fonts:/app/fonts\" \\\n  -v \"$PWD/cache:/var/cache/fontconfig\" \\\n  -w \"$PWD\" \\\n  ffmpeg-fonts-image \\\n  ffmpeg -v debug -y -f lavfi -i 'color=white,drawtext=text=Test:fontfile=Arial' -t 1s /app/output.mp4\n```\n\nInspecting the log, you will find that the font is located in `/app/fonts`.\n\n```shell\nOpening an input file: color=white,drawtext=text=Test:fontfile=Arial.\n[AVFilterGraph @ 0x7fb481827800] Setting 'color' to value 'white'\n[AVFilterGraph @ 0x7fb481827800] Setting 'text' to value 'Test'\n[AVFilterGraph @ 0x7fb481827800] Setting 'fontfile' to value 'Arial'\n[Parsed_drawtext_1 @ 0x7fb481827cc0] Using \"/app/fonts/arial.ttf\"\n```\n\n\u003e [!NOTE]\n\u003e The volume mount for `/var/cache/fontconfig` is optional. If you run the container as a non-root user, just make sure the cache directory exists on host before mounting, else it will still show the debug message `Fontconfig error: No writable cache directories`. This error does *not* further impact Fontconfig in locating the appropriate fonts.\n\n### TLS\n\nBinaries are built with TLS support but, by default, ffmpeg currently do\nnot do certificate verification. To enable verification you need to run\nffmpeg with `-tls_verify 1` and `-ca_file /path/to/cert.pem`.\n\n- Alpine Linux at `/etc/ssl/cert.pem`\n- Debian/Ubuntu install the `ca-certificates` package at it will be available at `/etc/ssl/certs/ca-certificates.crt`.\n\n### Known issues and tricks\n\n#### Multi-arch and arm64\n\nSince version 5.0.1-3 dockerhub images are multi-arch amd64 and arm64 images.\n\n#### Copy out binaries from image\n\nThis will copy `ffmpeg` and `ffprobe` to the current directory:\n```\ndocker run --rm -v \"$PWD:/out\" $(echo -e 'FROM alpine\\nCOPY --from=mwader/static-ffmpeg:7.1 /ff* /\\nENTRYPOINT cp /ff* /out' | docker build -q -)\n```\n\n#### Quickly see what versions an image was built with\n\n```\ndocker run --rm mwader/static-ffmpeg -v quiet -f data -i versions.json -map 0 -c copy -f data -\n```\n\n#### I see `Name does not resolve` errors for hosts that should resolve\n\nThis could happen if the hostname resolve to more IP-addresses than can fit in [DNS UDP packet](https://www.rfc-editor.org/rfc/rfc791) (probably 512 bytes) causing the response to be truncated. Usually clients should then switch to TCP and redo the query.\nThis should only be a problem with version 6.0-1 or earlier of this image that uses [musl libc](https://www.musl-libc.org) 1.2.3 or older.\n\n#### I see `[tls @ 0x7f80c8ec3800] error:030000A9:digital envelope routines::unknown option` errors\n\nThis could be because the statically linked openssl version in the static-ffmpeg binaries are not compatible with the (possibly distro modified openssl) configuration files found in the filesystem. The error is about openssl encountering an option that it does not know about.\n\nPossible workarounds:\n- Add `config_diagnostics = 0` to the openssl config to ignore unknown options with the risk of ignoring real problems.\n- Use ffmpeg option `-reconnect_on_network_error true` to ignore the error but will still warn.\n\nSee these references for further discussion and workarounds:\n- [First call to SSL_CTX_new is failing on AL2023 (3.0.12)\n](https://github.com/openssl/openssl/discussions/23016)\n- [OpenSSL issue with binary outside container (RedHat/Fedora specific)](https://github.com/wader/static-ffmpeg/issues/462)\n\n### Thanks\n\n- [@pyldin601](https://github.com/pyldin601) for working on multi arch builds\n\n### Contribute\n\nFeel free to create issues or PRs if you have any improvements or encounter any problems.\nPlease also consider making a [donation to the FFmpeg project](https://ffmpeg.org/donations.html)\nor to other projects used by this image if you find it useful.\n\nPlease also be mindful of the license limitations used by libraries this project uses and your own\nusage and potential distribution of such.\n\n### TODOs and possible things to add\n\n- Add libopenapv\n- Add libplacebo, chromaprint, etc. ...\n- Add acceleration support (GPU, CUDA, ...)\n- Add *.a *.so libraries, headers and pkg-config somehow\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwader%2Fstatic-ffmpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwader%2Fstatic-ffmpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwader%2Fstatic-ffmpeg/lists"}