Av1an Versions Save

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding

latest

1 month ago

Commits

  • 6632b47: append to log file (#817) (jcj83429) #817

0.4.2

3 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/master-of-zen/Av1an/compare/0.4.1...0.4.2

0.4.1

1 year ago

0.4.0-release

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/master-of-zen/Av1an/compare/0.3.1...0.4.0-release

0.3.1

2 years ago

Changes

  • Fix mkvmerge concatenation when resuming, and mkvmerge on Windows
  • Display possible vspipe errors when ffmpeg pipe is present
  • Add warning if rate control mode was not specified (for aomenc)

Full Changelog: https://github.com/master-of-zen/Av1an/compare/0.3.0...0.3.1

Windows binary

The provided binary in this release is dynamically linked to both the vapoursynth and ffmpeg libraries. Make sure the latest version of vapoursynth is installed, and that the ffmpeg DLLs are available. The ffmpeg DLLs can be downloaded from here: https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.4.1-full_build-shared.7z. Extract the files, and place the DLLs (which are in the bin directory once extracted) in the same directory as the downloaded av1an.exe

0.3.0

2 years ago

Changes

  • Add option to generate film grain tables for aomenc
  • Allow setting thread affinity for each worker
  • Remove overhead at the start and in-between scene detection and encoding
  • Better CLI interface
  • Automatic tiling for default settings
  • Always copy subtitles and all audio tracks
  • Improve logging (especially with --verbose)
  • Implement SSE4.1/SSSE3 SIMD-accelerated frame parsing for aomenc/vpxenc
  • Fix ffmpeg concat with spaces or quotes on all platforms
  • Fix mkvmerge for Windows
  • Automatically add cq-level arg if it is not present
  • Automatically set one-pass mode if --rt was specified
  • Add more info to --help
  • Remove max/min kf distance for aomenc and vpx

Full Changelog: https://github.com/master-of-zen/Av1an/compare/0.2.0...0.3.0

Windows binary

The provided binary in this release is dynamically linked to both the vapoursynth and ffmpeg libraries. Make sure the latest version of vapoursynth is installed, and that the ffmpeg DLLs are available. The ffmpeg DLLs can be downloaded from here: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z. Extract the files, and place the DLLs (which are in the bin directory once extracted) in the same directory as the downloaded av1an.exe

0.2.0

2 years ago

Rust rewrite

The first and most important change is that Av1an was completely rewritten in Rust, which improved the stability, performance, and maintainability of the project, which allows us to leverage tools and features that would simply not be possible with Python. Imagine not having syntax\typing errors on runtime :exploding_head:

Scene detection methods

Now, Av1an uses parts of the Rav1e encoder for scene change detection.

To sum it up

Lots of QOL improvements all around: faster encoding, static versions of av1an, faster target-quality, better and faster scene-detection, lower RAM usage, easier build process, etc.

There is just too much to cover :D

How is that possible?

The development, growth, and success of Av1an couldn't be possible without contributors that care and develop Av1an :kissing_heart: :heart: Those people are in descending order, but not significance:

@BlueSwordM @redzic @shssoichiro @luigi311 @n9Mtq4 @mxsrm @ishitatsuyuki @natis1 @Nestorfish @nathanielcwm

Note

Av1an now requires Vapoursynth Release Page

1.12

3 years ago

VVC support

NOTE: VVC is not yet finalized, and at the stage of test model so it can crash/don't work/behave strangely.

  • Added experimental VVC support
  • Temp YUV files created at the start of encoding for the segment, and removed after.
  • Concatenation to VVC bitstream is done by parcatStatic from VVC repository.

Usage

The encoding requires compiled encoder, bitstream concatenator, config_file from the VVC repository.

  • EncoderAppStatic and parcatStatic must be named vvc_encoder, vvc_concat, and placed in the directory from where they can be reachable, the same directory or somewhere in PATH. Place the chosen config file for the encoder in encoding folder.

  • Encoder set to VVC by -enc vvc

  • Config file passed to Av1an by --vvc_conf CONFIG_FILE

  • Required video encoding parameters: -wdt X - video width -hgt X - video height -fr X - framerate -q X - quantizer Example: -v " -wdt 640 -hgt 360 -fr 23.98 -q 30 "

  • After encode is done output file with extension .h266 will created It can be decoded to .yuv with VVC compliled decoder : DecoderAppStatic -d 8 -b encoded.h266 -o output.yuv Keep in mind that encoding time is excessive

Target VMAF for Rav1e, SVT-AV1, VPX

  • min_cq max_cq changed to min_q ,max_q
  • Default min_q max_q are set based on encoder.
  • Encoders must be in mode that requires setting quantizer. (--crf, --cq-level, --quantizer etc)

Examples:

Changed default passes for encoders

svt_av1: 1 
rav1e:   1
aom:    2
vpx:     2
x265:    1 
vvc:    1

Also, default encoding settings changed accordingly

1.11

3 years ago

There has been ~300 commits after the last release. Lots of changes, let's keep it short.

x265 + Target_VMAF

  • Added x265
  • Added target_vmaf support for x265 Usage: -enc x265 for encoder, --vmaf_target NUM as usual

Better target_vmaf

  • Instead of default mean for VMAF, 25 percentile is used instead. Making the worst parts of a scene weight more in the calculation, resulting in better results and more consistent quality.
  • Added early skips if extreme Q values beyond the range are more than enough or not enough to reach target VMAF. example: In log file with --vmaf_target 90:

Dynamic search for target Q value for the target_vmaf

OLD evenly spaced probes(blue x probe):

NEW dynamic search(green pentagon probe):

5 probes now enough to cover over extreme ranges

New splitting method: aom_keyframes

Usage: --split_method aom_keyframes

aom_keyframes use the first pass of aomenc for determining where keyframes will be placed by the encoder, and using this information for splitting, resulting in 0 loss of encoding efficiency by segmenting for this encoder.

Better error handling

Encoder error will now be printed to the terminal

Tons of refactoring and optimizations

  • Reducing complexity
  • Moving all the functions out of av1an.py to Av1an module
  • Overall better project organization

1.10

3 years ago

Target VMAF

The "Target VMAF" feature has a really simple goal, instead of guessing what the CQ value of your encoder will give you in regards to the resulting quality, we set the VMAF score we want to achieve and let the algorithm get the closest CQ value that will result in that score, for each split segment. Which simultaneously achieve 3 things, if compared to usual, single value CQ encode.

  1. Ensure that complex scenes receive more bit rate to achieve target quality.
  2. Increase quantizer value for simple scenes, and not going lower than target quality, and save bit rate.
  3. Yields a lower total bit rate.

From my testing, result size can be 50-80% of compared to usual encode, with great visual quality.

VMAF plotting

Plot contains VMAF score for each individual frame. Plotting after encode will be performed if flag --vmaf set, or --vmaf_target is used. The plot legend display Mean Average, Lower 1, 25, 75 percentile, which in combination with plot should be insightful enough for judging the quality of the encode instead of a single vmaf value for the whole video.

Example

This is a plot of the encode that was using Target VMAF 96 (don't mind nan in mean, it's fixed at time of this post, but i don't want to reencode:) )

The 1 percentile you can see on this plot shows the likely VMAF score of complex scenes, which usually involves a lot of movement, changes in perspective, zooming in and out and change in video context on every frame.

Usage

To try simply run your default constant quality encoding with --vmaf_target N, where N is VMAF score you try to achieve, i suggest something in 90-96 area.

--vmaf_target sets the VMAF score that Av1an will aim for. --min_cq - sets the lower boundary for the VMAF probes and limit the minimum cq value at which the video can be encoded. Default is 25. --max_cq sets the upper boundary for the VMAF probes and limit the maximum cq value at which the video can be encoded. Default is 50. --vmaf_steps - sets the number of probes that are used to get the best CQ value for the target VMAF. Default value is 4. If min-cq, max_cq are changed that distance between them increase - make sure to set steps that there is a probe for every ~5 CQ of distance

For more information about previous target VMAF refer to 1.8 release. This is evolution upon that method.

Also need to mention that Target VMAF currently only for reference AV1 encoder

Vmaf Plotting as separate package

VMAF plotting is available as separate package, and only needs VMAF's or ffmpeg's libvmaf result xml file to work. GITHUB_REPO

Extra splits

-xs, --extra_splits will add cuts for every N frames on splits that are longer than N, and spread cuts evenly, intelligently. This option help split big scenes or files that are long single scene, like camera recording, into splits that paralleled better.

For example:

--extra_splits 400 For a split that goes from frame 14000 to 14900, the distance between cuts is 900, 900/400= 2.25 which rounds to 2. Av1an will try to find 2 key frames that are closer to frame 14300 and 14600 and place the splits there. Another split from 0 to 500, Av1an will find key frame closer to 250 and place cut there. Splits that have less than 400 frames are not affected.