|
| 1 | +# FFmpeg Filters Documentation |
| 2 | + |
| 3 | +The tool in this repository builds an alternative presentation of the |
| 4 | +[official documentation for FFmpeg filters][offdocs]. It aims to be easier |
| 5 | +to read and easier to navigate. |
| 6 | + |
| 7 | +[][website] |
| 8 | + |
| 9 | +<!-- differences --> |
| 10 | + |
| 11 | +## Differences with the Official Documentation |
| 12 | + |
| 13 | +* Each filter has its own dedicated page. |
| 14 | + |
| 15 | +* Filters are organized into groups (like *Filters / Audio*, or |
| 16 | + *Sources / Multimedia*). |
| 17 | + |
| 18 | + The groups are guessed from the section headers in the official |
| 19 | + documentation. |
| 20 | + |
| 21 | +* All pages have a search box to jump to another filter. |
| 22 | + |
| 23 | + It can be focused by pressing the key <kbd>/</kbd>, and then use arrows |
| 24 | + (<kbd>↓</kbd>, <kbd>↑</kbd>) to select one of the results. |
| 25 | + |
| 26 | + The filter's description in the search results is the first sentence of its |
| 27 | + documentation. |
| 28 | + |
| 29 | +* Many code snippets are rendered with syntax highlighting. |
| 30 | + |
| 31 | + <!-- [highlight] This is an example from the filter:overlay filter: |
| 32 | +
|
| 33 | + ffmpeg -i left.avi -i right.avi -filter_complex " |
| 34 | + nullsrc=size=200x100 [background]; |
| 35 | + [0:v] setpts=PTS-STARTPTS, scale=100x100 [left]; |
| 36 | + [1:v] setpts=PTS-STARTPTS, scale=100x100 [right]; |
| 37 | + [background][left] overlay=shortest=1 [background+left]; |
| 38 | + [background+left][right] overlay=shortest=1:x=100 [left+right] |
| 39 | + " |
| 40 | + --> |
| 41 | + |
| 42 | + The highlighting is inferred from the content, so it may not work in some |
| 43 | + cases. The official documentation does not specify the language in which the |
| 44 | + snippets are written. |
| 45 | + |
| 46 | +* Responsive design for smaller screens. |
| 47 | + |
| 48 | +* Dark and light themes. |
| 49 | + |
| 50 | +* Documentation for all _major.minor_ versions, under *Other Vers.* in the sidebar. |
| 51 | + |
| 52 | + This is helpful when you have to use an older version of FFmpeg. |
| 53 | + |
| 54 | +* The *Version Matrix* shows which filters are available in each FFmpeg version. |
| 55 | + |
| 56 | +<!-- end differences --> |
| 57 | + |
| 58 | +## Usage |
| 59 | + |
| 60 | +The documentation can be [read in GitHub Pages][website], and it is possible to |
| 61 | +build it locally. |
| 62 | + |
| 63 | +### Nix Flakes |
| 64 | + |
| 65 | +The recommended way to run the generator is with [`nix run`][nix-run]: |
| 66 | + |
| 67 | +```console |
| 68 | +$ nix run github:ayosec/ffmpeg-filters-docs |
| 69 | +``` |
| 70 | + |
| 71 | +The tool accepts some command-line arguments (see `--help`). For example, to |
| 72 | +build only the documentation for FFmpeg 7.1 in the path `/tmp/ffdocs`: |
| 73 | + |
| 74 | +```console |
| 75 | +$ nix run github:ayosec/ffmpeg-filters-docs -- --versions 7.1 --output /tmp/ffdocs |
| 76 | +``` |
| 77 | + |
| 78 | +To execute the tool from a copy of this repository: |
| 79 | + |
| 80 | +```console |
| 81 | +$ nix develop --command ./ffmpeg-filters-docs […] |
| 82 | +``` |
| 83 | + |
| 84 | +### Docker |
| 85 | + |
| 86 | +A Docker image can be built with the file [`docker/Dockerfile`](./docker/Dockerfile). |
| 87 | + |
| 88 | +```console |
| 89 | +$ docker build --tag ffdocs --file docker/Dockerfile . |
| 90 | + |
| 91 | +$ docker run --volume /tmp/web:/tmp/web ffdocs --versions 7.1 --output /tmp/web |
| 92 | +``` |
| 93 | + |
| 94 | + |
| 95 | +[offdocs]: https://ffmpeg.org/ffmpeg-filters.html |
| 96 | +[website]: https://ayosec.github.io/ffmpeg-filters-docs/ |
| 97 | +[nix-run]: https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-run.html |
0 commit comments