2020-01-11 14:05:38 +00:00
< h1 align = "center" >
< br >
Av1an
< / br >
2020-05-08 04:44:45 +00:00
< / h1 >
2020-01-11 14:05:38 +00:00
2020-07-22 20:21:59 +00:00
< h2 align = "center" > A cross-platform framework to streamline encoding< / h2 >
2020-01-11 14:05:38 +00:00
2020-11-06 20:24:51 +00:00
![alt text ](https://cdn.discordapp.com/attachments/696849974666985494/774368268860915732/av1an_pick2.png )
2020-01-12 03:44:02 +00:00
2020-05-08 22:01:19 +00:00
< h4 align = "center" >
2020-10-05 19:16:54 +00:00
< a href = "https://discord.gg/Ar8MvJh" > < img src = "https://discordapp.com/api/guilds/696849974230515794/embed.png" alt = "Discord server" / > < / a >
2020-07-08 20:40:45 +00:00
< img src = "https://github.com/master-of-zen/Av1an/workflows/tests/badge.svg" >
2021-07-19 01:34:33 +00:00
2020-02-16 16:00:26 +00:00
< / h4 >
2020-05-16 15:13:02 +00:00
< h2 align = "center" > Easy, Fast, Efficient and Feature Rich< / h2 >
2020-01-13 14:07:26 +00:00
2021-06-01 14:07:40 +00:00
An easy way to start using AV1 / HEVC / H264 / VP9 / VP8 encoding. AOM, RAV1E, SVT-AV1, SVT-VP9, VPX, x265, x264 are supported.
2020-05-08 04:44:45 +00:00
2020-01-12 03:44:02 +00:00
Example with default parameters:
2020-04-25 14:27:07 +00:00
av1an -i input
2020-01-12 03:44:02 +00:00
2020-01-13 14:07:26 +00:00
With your own parameters:
2020-01-12 03:44:02 +00:00
2021-10-30 11:49:26 +00:00
av1an -i input -v " --cpu-used=3 --end-usage=q --cq-level=30 --threads=8" -w 10
--target-quality 95 -a " -c:a libopus -ac 2 -b:a 192k" -l my_log -o output.mkv
2021-05-15 05:50:18 +00:00
2020-01-13 14:07:26 +00:00
< h2 align = "center" > Usage< / h2 >
2021-10-30 11:49:26 +00:00
-i --input Input file, or Vapoursynth (.py,.vpy) script
2021-05-12 06:49:25 +00:00
(relative or absolute path)
2020-02-14 06:42:25 +00:00
2021-07-26 10:02:39 +00:00
-o --output-file Name/Path for output file (Default: (input file name)_(encoder).mkv)
2021-08-08 23:42:48 +00:00
Output is `mkv` by default
Ouput extension can be set to: `mkv` , `webm` , `mp4`
2020-02-14 06:42:25 +00:00
2021-07-26 10:02:39 +00:00
-e --encoder Encoder to use
2021-07-22 09:49:04 +00:00
[default: aom] [possible values: aom, rav1e, vpx, svt-av1, x264, x265]
2020-01-16 09:38:52 +00:00
2021-07-26 10:02:39 +00:00
-v --video-params Encoder settings flags (If not set, will be used default parameters.)
2020-01-27 18:55:00 +00:00
Must be inside ' ' or " "
2020-02-14 06:42:25 +00:00
2021-07-26 10:02:39 +00:00
-p --passes Set number of passes for encoding
2020-11-08 18:33:06 +00:00
(Default: AOMENC: 2, rav1e: 1, SVT-AV1: 1, SVT-VP9: 1,
2021-06-01 13:53:00 +00:00
VPX: 2, x265: 1, x264: 1)
2020-02-14 06:42:25 +00:00
2021-07-26 10:02:39 +00:00
-w --workers Override number of workers.
2020-11-08 18:33:06 +00:00
2021-07-26 10:02:39 +00:00
-r --resume Resumes encoding.
2020-07-26 15:23:39 +00:00
2021-02-20 13:26:19 +00:00
--keep Doesn't delete temporary folders after encode has finished.
2020-07-26 15:23:39 +00:00
2021-07-26 10:02:39 +00:00
-q --quiet Do not print a progress bar to the terminal.
2021-01-09 20:37:01 +00:00
2021-07-26 10:02:39 +00:00
-l --logging Path to .log file(By default created in temp folder)
2020-07-26 15:23:39 +00:00
2021-07-22 09:49:04 +00:00
--temp Set path for the temporary folder. [default: .hash]
2020-11-08 18:33:06 +00:00
2021-07-26 10:02:39 +00:00
-c --concat Concatenation method to use for splits Default: ffmpeg
2021-07-09 16:32:47 +00:00
[possible values: ffmpeg, mkvmerge, ivf]
2021-06-05 00:22:48 +00:00
2020-07-26 16:50:10 +00:00
< h3 align = "center" > FFmpeg options< / h3 >
2021-07-26 10:02:39 +00:00
-a --audio-params FFmpeg audio settings (Default: copy audio from source to output)
2020-07-26 16:50:10 +00:00
Example: -a '-c:a libopus -b:a 64k'
2021-07-26 10:02:39 +00:00
-f --ffmpeg FFmpeg options video options.
2021-05-12 06:49:25 +00:00
Applied to each encoding segment individually.
2021-05-15 05:50:18 +00:00
(Warning: Cropping doesn't work with Target VMAF mode
2021-07-09 16:32:47 +00:00
without specifying it in --vmaf-filter)
2020-07-26 15:23:39 +00:00
Example:
2020-08-18 19:41:43 +00:00
--ff " -vf scale=320:240 "
2020-07-26 15:23:39 +00:00
2021-07-09 16:32:47 +00:00
--pix-format Setting custom pixel/bit format for piping
2020-11-12 17:09:02 +00:00
(Default: 'yuv420p10le')
2020-07-26 15:23:39 +00:00
< h3 align = "center" > Segmenting< / h3 >
2020-02-14 06:42:25 +00:00
2021-07-12 20:14:42 +00:00
--split-method Method used for generating splits.(Default: av-scenedetect)
Options: `av-scenedetect` , `none`
2021-07-22 09:49:04 +00:00
`none` - skips scenedetection.
2020-06-09 15:30:03 +00:00
2021-07-09 16:32:47 +00:00
-m --chunk-method Determine the method in which chunks are made for encoding.
2021-07-22 09:49:04 +00:00
By default the best method is selected automatically.
[possible values: segment, select, ffms2, lsmash, hybrid]
2021-07-26 10:02:39 +00:00
-s --scenes File to save/read scenes.
2021-07-22 09:49:04 +00:00
-x --extra-split Size of chunk after which it will be split [default: 240]
2020-07-02 12:36:58 +00:00
2021-07-09 16:32:47 +00:00
--min-scene-len Specifies the minimum number of frames in each split.
2021-02-20 13:26:19 +00:00
2020-11-08 18:33:06 +00:00
< h3 align = "center" > Target Quality< / h3 >
2021-07-09 16:32:47 +00:00
--target-quality Quality value to target.
2020-11-10 13:32:46 +00:00
VMAF used as substructure for algorithms.
2021-07-22 09:49:04 +00:00
When using this mode, you must use quantizer/quality modes of enocoder.
2020-11-08 18:33:06 +00:00
2021-07-09 16:32:47 +00:00
--target-quality-method Type of algorithm for use.
2021-06-04 02:05:27 +00:00
Options: per_shot
2020-12-18 16:13:02 +00:00
2021-07-09 16:32:47 +00:00
--min-q, --max-q Min,Max Q values limits
2021-02-20 13:26:19 +00:00
If not set by the user, the default for encoder range will be used.
2020-11-08 18:33:06 +00:00
2021-05-19 12:21:09 +00:00
--vmaf Calculate VMAF after encoding is done and make a plot.
2020-11-08 18:33:06 +00:00
2021-07-09 16:32:47 +00:00
--vmaf-path Custom path to libvmaf models.
example: --vmaf-path "vmaf_v0.6.1.pkl"
2021-05-19 12:21:09 +00:00
Recommended to place both files in encoding folder
2020-07-26 18:04:11 +00:00
(`vmaf_v0.6.1.pkl` and `vmaf_v0.6.1.pkl.model` )
2021-02-20 13:26:19 +00:00
(Required if VMAF calculation doesn't work by default)
2020-04-24 21:28:19 +00:00
2021-07-22 09:49:04 +00:00
--vmaf-res Resolution for VMAF calculation.
[default: 1920x1080]
2020-07-25 22:57:00 +00:00
2021-07-22 09:49:04 +00:00
--probes Number of probes for target quality. [default: 4]
2020-11-08 18:33:06 +00:00
2021-07-22 09:49:04 +00:00
--probe-slow Use probided video encoding parameters for vmaf probes.
2021-06-08 21:39:14 +00:00
2021-07-09 16:32:47 +00:00
--vmaf-filter Filter used for VMAF calculation. The passed format is filter_complex.
2020-10-16 18:54:36 +00:00
So if crop filter used ` -ff " -vf crop=200:1000:0:0 "`
2021-07-09 16:32:47 +00:00
`--vmaf-filter` must be : ` --vmaf-filter "crop=200:1000:0:0"`
2020-11-08 18:33:06 +00:00
2021-07-22 09:49:04 +00:00
--probing-rate Setting rate for VMAF probes. Using every N frame used in probe.
[default: 4]
2020-11-08 18:33:06 +00:00
2021-07-09 16:32:47 +00:00
--vmaf-threads Limit number of threads that are used for VMAF calculation
2020-05-08 22:01:19 +00:00
2020-01-12 03:44:02 +00:00
< h2 align = "center" > Main Features< / h2 >
2021-02-20 13:26:19 +00:00
**Splitting video by scenes for parallel encoding** because AV1 encoders are currently not very good at multithreading and encoding is limited to a very limited number of threads.
2020-01-12 03:44:02 +00:00
2021-02-14 01:42:17 +00:00
- [Vapoursynth ](http://www.vapoursynth.com ) script input support.
2021-07-22 09:49:04 +00:00
- Speed up video encoding.
2021-02-20 13:26:19 +00:00
- Target Quality mode. Targeting end result reference visual quality. VMAF used as a substructure
2021-02-06 21:38:51 +00:00
- Resuming encoding without loss of encoded progress.
- Simple and clean console look.
- Automatic detection of the number of workers the host can handle.
2021-07-22 09:49:04 +00:00
- Both video and audio transcoding.
2020-05-08 04:34:25 +00:00
## Install
2021-09-07 13:16:08 +00:00
- With a package manager:
- `cargo install av1an`
- [CARGO ](https://crates.io/crates/av1an )
- [AUR ](https://aur.archlinux.org/packages/av1an-git/ )
2021-05-15 05:50:18 +00:00
2021-02-06 21:38:51 +00:00
- Prerequisites:
- [Install FFmpeg ](https://ffmpeg.org/download.html )
2021-07-22 09:49:04 +00:00
- Recommended to install vapoursynth with lsmash/ffms2 for faster and better processing
2021-02-06 21:38:51 +00:00
- Encoder of choice:
- [Install AOMENC ](https://aomedia.googlesource.com/aom/ )
- [Install rav1e ](https://github.com/xiph/rav1e )
2021-04-21 23:04:03 +00:00
- [Install SVT-AV1 ](https://gitlab.com/AOMediaCodec/SVT-AV1 )
2021-02-06 21:38:51 +00:00
- [Install SVT-VP9 ](https://github.com/OpenVisualCloud/SVT-VP9 )
- [Install vpx ](https://chromium.googlesource.com/webm/libvpx/ ) VP9, VP8 encoding
- Optional :
- [Vapoursynth ](http://www.vapoursynth.com/ )
- [ffms2 ](https://github.com/FFMS/ffms2 )
- [lsmash ](https://github.com/VFR-maniac/L-SMASH-Works )
- [mkvmerge ](https://mkvtoolnix.download/ )
- Manually:
- Clone Repo or Download from Releases
2021-07-22 09:49:04 +00:00
- `cargo build --release`
2021-01-31 20:26:26 +00:00
## Docker
2021-02-06 21:38:51 +00:00
2021-05-15 05:50:18 +00:00
Av1an can be run in a Docker container with the following command if you are in the current directory
Linux
2021-01-31 20:26:26 +00:00
```bash
2021-07-09 16:32:47 +00:00
docker run --privileged -v "$(pwd):/videos" --user $(id -u):$(id -g) -it --rm masterofzen/av1an:latest -i S01E01.mkv {options}
2021-01-31 20:26:26 +00:00
```
2021-05-15 05:50:18 +00:00
Windows
2021-05-15 06:09:01 +00:00
```powershell
2021-07-09 16:32:47 +00:00
docker run --privileged -v "${PWD}:/videos" -it --rm masterofzen/av1an:latest -i S01E01.mkv {options}
2021-05-15 06:09:01 +00:00
```
2021-01-31 20:26:26 +00:00
Docker can also be built by using
2021-02-06 21:38:51 +00:00
2021-01-31 20:26:26 +00:00
```bash
docker build -t "av1an" .
```
2021-02-06 21:38:51 +00:00
2021-01-31 20:26:26 +00:00
To specify a different directory to use you would replace $(pwd) with the directory
2021-02-06 21:38:51 +00:00
2021-01-31 20:26:26 +00:00
```bash
2021-07-09 16:32:47 +00:00
docker run --privileged -v "/c/Users/masterofzen/Videos":/videos --user $(id -u):$(id -g) -it --rm masterofzen/av1an:latest -i S01E01.mkv {options}
2021-01-31 20:26:26 +00:00
```
2021-05-15 06:09:01 +00:00
The --user flag is required on linux to avoid permission issues with the docker container not being able to write to the location, if you get permission issues ensure your user has access to the folder that you are using to encode.
2021-02-10 05:41:53 +00:00
### Docker tags
The docker image has the following tags
| Tag | Description |
| :-------: | ----------------------------------------------------- |
| latest | Contains the latest stable av1an version release |
| master | Contains the latest av1an commit to the master branch |
| sha-##### | Contains the commit of the hash that is referenced |
| #.## | Stable av1an version release |
2021-02-20 13:26:19 +00:00
### Support the developer
2020-05-08 04:34:25 +00:00
2021-02-26 13:55:06 +00:00
Bitcoin - 1GTRkvV4KdSaRyFDYTpZckPKQCoWbWkJV1