Av1an/README.md

167 lines
8.2 KiB
Markdown
Raw Normal View History

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-04 00:32:30 +00:00
<h2 align="center">A cross-platform framework for streamlining AV1 encoding</h2>
2020-01-11 14:05:38 +00:00
2020-03-05 12:39:02 +00:00
![alt text](https://cdn.discordapp.com/attachments/665440744567472169/685103807952060447/143740_05_03_20.png)
2020-01-12 03:44:02 +00:00
2020-05-08 22:01:19 +00:00
<h4 align="center">
2020-04-21 23:45:56 +00:00
<a href="https://discord.gg/TssVH86"><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">
2020-07-09 20:24:44 +00:00
<a href="https://codeclimate.com/github/master-of-zen/Av1an/maintainability"><img src="https://api.codeclimate.com/v1/badges/41ea7ad221dcdad3fe8d/maintainability" />
2020-02-16 16:00:26 +00:00
<img= src="https://app.codacy.com/manual/Grenight/Av1an?utm_source=github.com&utm_medium=referral&utm_content=master-of-zen/Av1an&utm_campaign=Badge_Grade_Dashboard"></a>
<a href="https://www.codacy.com/manual/Grenight/Av1an?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=master-of-zen/Av1an&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/4632dbb2f6f34ad199142c01a3eb2aaf"/></a>
</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
2020-05-08 20:10:57 +00:00
An easy way to start using AV1 / VP9 / VP8 encoding. AOM, rav1e, SVT-AV1, VPX 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
2020-07-09 20:36:16 +00:00
av1an -i input -enc aom -v " --cpu-used=3 --end-usage=q --cq-level=30 --threads=8 " -w 10
2020-06-18 09:37:45 +00:00
-ff " -vf scale=-1:720 " -a " -c:a libopus -b:a 24k " -s scenes.csv -log my_log -o output
2020-01-12 03:44:02 +00:00
2020-01-13 14:07:26 +00:00
<h2 align="center">Usage</h2>
2020-05-26 07:59:10 +00:00
-i --file_path Input file(s) (relative or absolute path). Will be processed with same
settings.
2020-02-14 06:42:25 +00:00
2020-05-13 03:07:06 +00:00
-o --output_file Name/Path for output file (Default: (input file name)_av1.mkv)
2020-04-22 17:28:50 +00:00
Output file ending is always `.mkv`
2020-02-14 06:42:25 +00:00
2020-04-24 21:28:19 +00:00
-enc --encoder Encoder to use (aom,rav1e,svt_av1,vpx. Default: aom)
2020-01-16 09:38:52 +00:00
Example: -enc rav1e
2020-02-17 14:13:16 +00:00
-v --video_params Encoder settings flags (If not set, will be used default parameters.
2020-01-16 04:30:21 +00:00
Required for SVT-AV1s)
2020-01-27 18:55:00 +00:00
Must be inside ' ' or " "
2020-02-14 06:42:25 +00:00
2020-02-17 14:09:10 +00:00
-p --passes Set number of passes for encoding
2020-05-25 18:28:43 +00:00
(Default: AOMENC: 2, rav1e: 1, SVT-AV1: 2, VPX: 2)
2020-05-08 04:34:25 +00:00
At current moment 2nd pass rav1e not working
2020-02-14 06:42:25 +00:00
2020-01-13 17:04:14 +00:00
-a --audio_params FFmpeg audio settings flags (Default: copy audio from source to output)
2020-02-03 23:09:23 +00:00
Example: -a '-c:a libopus -b:a 64k'
2020-02-14 06:42:25 +00:00
2020-03-26 11:35:49 +00:00
-w --workers Overrides automatically set number of workers.
2020-05-08 04:34:25 +00:00
Example: rav1e settings " ... --tile-rows 2 --tile-cols 2 ... " -w 3
2020-02-14 06:42:25 +00:00
2020-06-09 15:30:03 +00:00
--split_method Method used for generating splits.(Default: PySceneDetect)
Options: `pyscene`, `aom_keyframes`
2020-07-02 12:36:58 +00:00
`pyscene` - PyScenedetect, content based scenedetection
2020-06-09 15:30:03 +00:00
with threshold.
`aom_keyframes` - using stat file of 1 pass of aomenc encode
to get exact place where encoder will place new keyframes.
2020-05-16 15:01:29 +00:00
-tr --threshold PySceneDetect threshold for scene detection Default: 50
2020-07-02 12:36:58 +00:00
2020-02-06 00:43:33 +00:00
-s --scenes Path to file with scenes timestamps.
2020-02-07 23:25:04 +00:00
If given `0` spliting will be ignored
2020-02-06 00:43:33 +00:00
If file not exist, new will be generated in current folder
2020-02-14 06:42:25 +00:00
First run to generate stamps, all next reuse it.
2020-03-01 13:29:08 +00:00
Example: "-s scenes.csv"
2020-07-02 12:36:58 +00:00
2020-05-16 15:01:29 +00:00
-xs --extra_split Adding extra splits if frame distance beetween splits bigger than
given value. Split only on keyframes. Works with/without PySceneDetect
2020-07-02 12:36:58 +00:00
Example: 1000 frames video with single scene,
-xs 200 will try to add splits at keyframes
2020-05-16 15:01:29 +00:00
that closest to 200,400,600,800.
2020-07-02 12:36:58 +00:00
2020-05-13 03:07:06 +00:00
-cfg Save/Read config file with encoder, encoder parameters,
FFmpeg and audio settings.
2020-02-14 06:42:25 +00:00
2020-05-26 07:59:10 +00:00
-ff --ffmpeg FFmpeg options. Applied to each segment individually.
2020-04-03 18:17:29 +00:00
Example:
2020-03-01 13:29:08 +00:00
--ff " -r 24 -vf scale=320:240 "
2020-02-14 06:42:25 +00:00
2020-01-26 20:58:45 +00:00
-fmt --pix_format Setting custom pixel/bit format(Default: 'yuv420p')
Example for 10 bit: 'yuv420p10le'
2020-02-17 13:22:34 +00:00
Encoding options should be adjusted accordingly.
2020-02-14 06:42:25 +00:00
--resume If encode was stopped/quit resumes encode with saving all progress
Resuming automatically skips scenedetection, audio encoding/copy,
spliting, so resuming only possible after actuall encoding is started.
/.temp folder must be presented for resume.
2020-03-27 22:31:21 +00:00
--no_check Skip checking numbers of frames for source and encoded chunks.
2020-04-24 21:28:19 +00:00
Needed if framerate changes to avoid console spam.
2020-03-27 22:31:21 +00:00
By default any differences in frames of encoded files will be reported.
2020-03-26 11:35:49 +00:00
2020-03-27 22:31:21 +00:00
--keep Not deleting temprally folders after encode finished.
2020-03-26 11:35:49 +00:00
2020-01-22 08:54:10 +00:00
-log --logging Path to .log file(Default: no logging)
2020-03-26 11:35:49 +00:00
2020-04-22 17:37:05 +00:00
--temp Set path for temporally folders. Default: .temp
2020-03-26 11:35:49 +00:00
2020-07-09 20:36:16 +00:00
--boost Enable experimental CQ boosting for dark scenes. See 1.7 release notes.
2020-03-26 11:35:49 +00:00
2020-07-02 12:36:58 +00:00
-br --boost_range CQ limit for boosting. CQ can't get lower than this value.
2020-03-26 11:35:49 +00:00
2020-07-02 12:36:58 +00:00
-bl --boost_limit CQ range for boosting. Delta for which CQ can be changed
2020-05-08 22:01:19 +00:00
2020-03-26 21:35:08 +00:00
--vmaf Calculate vmaf for each encoded clip.
2020-05-22 13:06:34 +00:00
Saves plot after encode, showing vmaf values for all frames,
mean, 1,25,75 percentile.
2020-05-08 22:01:19 +00:00
2020-07-09 20:36:16 +00:00
--vmaf_path Custom path to libvmaf models. By default used system one.
2020-05-08 22:01:19 +00:00
2020-07-09 20:36:16 +00:00
--vmaf_target Vmaf value to target. Currently aomenc only.
Best works with 85-97.
2020-06-07 16:09:05 +00:00
When using this mode specify full encoding options.
2020-07-02 12:36:58 +00:00
` --end-usage=q ` or ` --end-usage=cq `
2020-06-07 16:09:05 +00:00
with ` --cq-level=N ` must be specified.
2020-04-24 21:28:19 +00:00
2020-07-09 20:36:16 +00:00
--vmaf_steps Number of probes for interpolation.
2020-04-24 21:28:19 +00:00
Must be bigger than 3. Optimal is 4-6 probes. Default: 4
2020-05-08 22:01:19 +00:00
2020-07-09 20:36:16 +00:00
--min_cq, --max_cq Min,Max CQ values used in interpolation for target Vmaf
2020-05-17 17:01:29 +00:00
Use to limit CQ values range. Default: 25, 50.
2020-01-13 14:07:26 +00:00
2020-01-12 03:44:02 +00:00
<h2 align="center">Main Features</h2>
2020-01-15 03:09:33 +00:00
**Spliting video by scenes for parallel encoding** because AV1 encoders currently not good at multithreading, encoding is limited to single or couple of threads at the same time.
2020-01-12 03:44:02 +00:00
2020-05-08 22:01:19 +00:00
* [PySceneDetect](https://pyscenedetect.readthedocs.io/en/latest/) used for spliting video by scenes and running multiple encoders.
* Fastest way to encode AV1 without losing quality, as fast as many cores cpu have :).
2020-06-07 16:09:05 +00:00
* Target VMAF mode. Targeting end result visual quality.
2020-05-08 22:01:19 +00:00
* Resuming encoding without loss of encoded progress.
* Simple and clean console look.
* Automatic determination of how many workers the host can handle.
* Building encoding queue with bigger files first, minimizing waiting for last scene to encode.
* Both video and audio transcoding with FFmpeg.
* Logging of progress of all encoders.
* "Boosting" quality of dark scenes based on their brightness.
2020-05-08 04:34:25 +00:00
## Install
* Prerequisites:
2020-05-08 22:01:19 +00:00
* [Install Python3](https://www.python.org/downloads/) <br>
For Windows in the installer check the option to `add Python to PATH`
2020-05-08 22:01:19 +00:00
* [Install FFmpeg](https://ffmpeg.org/download.html)
2020-05-16 04:19:25 +00:00
* [Install AOMENC](https://aomedia.googlesource.com/aom/)
2020-07-02 12:36:58 +00:00
* [Install rav1e](https://github.com/xiph/rav1e)
* [Install SVT-AV1](https://github.com/OpenVisualCloud/SVT-AV1)
2020-05-16 04:19:25 +00:00
* [Install vpx](https://chromium.googlesource.com/webm/libvpx/) VP9, VP8 encoding
2020-04-25 16:15:58 +00:00
2020-05-08 04:34:25 +00:00
* With a package manager:
2020-05-08 22:01:19 +00:00
* [PyPI](https://pypi.org/project/Av1an/)
* [AUR](https://aur.archlinux.org/packages/python-av1an/)
2020-04-25 16:15:58 +00:00
2020-05-08 04:34:25 +00:00
* Manually:
2020-01-18 05:59:32 +00:00
2020-05-08 22:01:19 +00:00
* Clone Repo or Download from Releases
* `python setup.py install`
2020-05-14 02:47:25 +00:00
* Also:
On ubuntu systems packages `python3-opencv` and `libsm6` are required
2020-04-29 20:05:00 +00:00
2020-06-02 04:48:09 +00:00
### I have no money
2020-05-08 04:34:25 +00:00
2020-03-01 20:50:48 +00:00
Bitcoin - 1gU9aQ2qqoQPuvop2jqC68JKZh5cyCivG