From f0ec83982f0ead013fba95696927bde236fe5d9d Mon Sep 17 00:00:00 2001 From: Federico Carboni <48333714+FedericoCarboni@users.noreply.github.com> Date: Thu, 21 Dec 2023 19:21:06 +0100 Subject: [PATCH] docs --- README.md | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fec1160..17b047d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,23 @@ # setup-ffmpeg -Setup FFmpeg in GitHub Actions to use `ffmpeg` and `ffprobe`. The action will download, -cache and add to `PATH` a recent FFmpeg build for the current os. +This action sets up and caches a specific FFmpeg version, providing the `ffmpeg` +and `ffprobe` commands. -Only 64-bit Linux, Windows and Mac OS are supported. +Builds are provided by the following sources: + +- Linux builds +- Windows builds +- MacOS builds + +## v3 vs v1 + +Version 3 of this action downloads binaries directly from the sources listed above +instead of periodically updating GitHub releases. In turn this means it receives +updates more frequently and supports older versions and git releases. ## Usage -To use `ffmpeg` and `ffprobe`, run the action before them. +See [`action.yml`](./action.yml). ```yml steps: @@ -17,30 +27,25 @@ steps: with: # A specific version to download, may also be "release" or a specific version # like "6.1.0". At the moment semver specifiers (i.e. >=6.1.0) are supported - # only on Windows, on other platforms the version is matched exactly. + # only on Windows, on other platforms they are allowed but version is matched + # exactly. # As of version 3, this action -- by default -- uses the latest release version # available for the platform. As upstream sources are not guaranteed to update # at the same time, the action may install different versions of ffmpeg for # different operating systems, unless a specific version is requested. - # Default: "release" ffmpeg-version: release + # Target architecture of the ffmpeg executable to install. Defaults to the + # system architecture. Only x64 and arm64 are supported (arm64 only on Linux). + architecture: '' # As of version 3 of this action, builds are no longer downloaded from GitHub # except on Windows: https://github.com/GyanD/codexffmpeg/releases. - # Default: ${{ github.token }} - github-token: ${{ github.token }} + github-token: ${{ github.server_url == 'https://github.com' && github.token || '' }} - run: ffmpeg -i input.avi output.mkv ``` -This action also sets a few outputs: - -- `path`: Path to the install directory -- `ffmpeg-path`: Path to the ffmpeg executable -- `ffprobe-path`: Path to the ffprobe executable - -## FFmpeg Version - -The action downloads builds from the following sources depending on the platform: +### Outputs -- Linux Builds - -- Windows Builds - -- MacOS Builds - +- `ffmpeg-version`: Installed version of FFmpeg. +- `ffmpeg-path`: Path to the install directory containing `ffmpeg` and `ffprobe` +commands. +- `cache-hit`: A boolean value indicating whether the tool cache was hit.