Commit graph

2236 commits

Author SHA1 Message Date
Josh Holmer 0aa8fc5281
Automatically add cq-level arg if it is not present (#460)
* Automatically add cq-level arg if it is not present

Currently, target quality requires a cq-level (or equivalent for the
encoder) arg to be present in order to work, so that it can replace the
existing cq-level with the new one. This commit makes it so that if the
arg is not present, av1an will insert it with the proper quality level.

* Use format! for insert_q

Co-authored-by: Redzic <yusufredzic@gmail.com>
2021-12-22 01:14:34 +00:00
Josh Holmer 307b9d6958 Queue rules also needed to be updated 2021-12-16 09:25:27 -05:00
Josh Holmer ab59a07659 Auto-merge if no tests were run because only config files modified 2021-12-16 09:20:46 -05:00
redzic 4014164c81
Update indicatif (#455) 2021-12-16 14:06:16 +00:00
redzic cad9b83af2
Fix clippy warnings (#451) 2021-12-16 01:25:46 +00:00
Josh Holmer d926b9615a Fix config again 2021-12-15 20:08:56 -05:00
Josh Holmer 181aa7f2f0 Avoid premium feature 2021-12-15 20:06:06 -05:00
Josh Holmer 056ecbd35f Fix test name matching for mergify 2021-12-15 19:48:02 -05:00
Josh Holmer 4cac50136f Additional changes for mergify
- Remove usage of deprecated "strict" param by using queues
- Add auto merge for stable backports
- Fix assignees for stable patches
2021-12-15 18:33:09 -05:00
Josh Holmer 56461c6b17
Add mergify config (#445)
* Add mergify config

This config includes the following rules:

- Automatically merge once a PR passes all tests and is approved.
- Automatically backport each PR from our main branch into our stable branch

* Merge all tests into one run

* Cleanup and speed up test suite

* Migrate to a docker image with dav1d

* Create CI profile with debug assertions enabled

* Use faster params for all encoders

Co-authored-by: Redzic <yusufredzic@gmail.com>
2021-12-15 17:58:00 -05:00
Josh Holmer 519bd0504e Merge branch 'unstable' 2021-12-15 15:03:21 -05:00
Redzic a5b6f18aee fix indicatif... again 2021-12-15 10:58:52 -06:00
redzic 9e8c2da1d9
cargo update + revert indicatif (#447) 2021-12-15 10:57:51 -06:00
redzic 13d862472e
Add extra conditional for tpl_crash_workaround (#446)
This commit avoids double-printing the TPL error message and checking the stderr again if tpl_crash_workaround was already enabled.
2021-12-14 20:43:30 -06:00
Josh Holmer 2be2c79ca7
Retry chunk without TPL if a TPL-related crash occurs (#444)
aomenc has had a history of crashes related to TPL on certain
chunks, particularly in videos with less motion, such as animated
content. This commit enables a workaround to retry a chunk with TPL
disabled if such a crash is detected. Although there is some amount of
psychovisual quality loss with TPL disabled, this is preferable to being
unable to complete the encode.
2021-12-14 17:17:07 -06:00
redzic 14836c04e4
Avoid multiple deserialization of same VMAF json score file (#443)
* Avoid multiple deserialization of same VMAF json score file

This avoids multiple deserialization of the same VMAF json file
when plotting the VMAF file by deserializing once and sorting,
but still using select_nth_unstable_by in the case of
read_weighted_vmaf which is now only called if we want a single
percentile out of the VMAF file.

* Fix small spelling errors
2021-12-10 11:16:14 -06:00
redzic 9922b13c7d
Simplify target quality probe names (#442)
This shouldn't cause any breaking changes since it doesn't affect (de)serialization and when resuming we don't read the probes again.
2021-12-10 10:12:03 -06:00
Redzic 2b3e255878 Fix nightly clippy warnings 2021-12-10 01:32:39 -06:00
redzic 6f46ef8531
Replace last regex with hand written parser (#441)
* Replace panic with error return

* Replace last regex with hand written parser

* Update dependencies

* Fix clippy warnings

* Adjust idx check

* More idiomatic rust
2021-12-10 01:23:24 -06:00
Redzic f360a9b0d6 Render the progress bar at 60 fps
This is not in `master` as indicatif at 15 fps is already too slow
in some situations, so we don't want to slow it down further until
further investigation has been done.
2021-12-09 12:29:15 -06:00
Redzic d07036dd5e Add unstable to the version info 2021-12-09 12:29:15 -06:00
Josh Holmer 28ab3b406a Add kbps and final file size estimates to progress bar (#439)
* Add kbps and final file size estimates to progress bar

This looks at the size of each chunk when it completes and saves that
size in kilobytes into the done.json file. For backwards compatibility
for encodes resumed from an earlier version of av1an, if the done.json
does not contain the chunk size, then on resume, av1an will lookup the
size of that chunk. The estimates on the progress bar also handle
resumes and chunk crashes gracefully.

* Include audio size in estimates
2021-12-09 12:29:15 -06:00
Josh Holmer 8268cb417a Fix another clippy lint (#437) 2021-12-09 12:29:15 -06:00
Redzic 724452c805 Add optional --sc-pix-format argument
This argument optionally allows the scene detection to run on a
different pixel format, which allows you to for example run 8-bit scene
detection on a 10-bit source, which can be much faster.

This option is unstable because ideally we would instead have this
take the bit depth as an integer instead, as we do not want to allow any arbitrary
pixel format for scene detection. Also, it would waste some CPU time
converting from 4:4:4 to 4:2:0 for example considering that we only
consider the luma plane for scene detection, so ideally we'd have some
code to automatically pick a format that would avoid useless conversions
based on the desired bit depth.
2021-12-09 12:15:08 -06:00
Josh Holmer 07710cb088
Fix another clippy lint (#437) 2021-12-09 09:33:48 -06:00
Redzic 1e5dfaa095 Reduce code size of construct_target_quality_command further
- The compiler currently generates a lot of extra code when mixing
  owned and borrowed strings with `into_vec!`, so this commit
  introduces an `inplace_vec!` macro to avoid this issue.

  Overall, `inplace_vec!` reduces the overall size of
  construct_target_quality_command by ~20% as compared to using
  `into_vec!`. Compared to the original code, which used `to_string`
  on integers instead of `format!`, it is ~40% smaller.

- Replace a small heap allocation in `vmaf.rs` with `SmallVec`.
2021-12-02 02:34:38 -06:00
Redzic cdf277eeaf Reduce codesize of construct_target_quality_command
- `x.to_string()` generates much more code than `format!("{}", x)`,
  so we should prefer `format!`. There are other ways to further
  reduce the codesize of construct_target_quality_command, but
  they are much more complicated, so they are reserved for a
  future PR.

- Update dependencies.
2021-12-01 21:02:48 -06:00
Redzic 69633b18a8 Get the frame count from done.json when resuming
ffmpeg takes a long time to get the frame count for some sources,
and it can be much faster to get it from done.json when resuming
instead of recalculating it every time encoding is resumed.
2021-12-01 18:28:48 -06:00
redzic fc33d24b89
Add --max-tries argument to set maximum chunk restarts (#433) 2021-11-28 18:38:01 -06:00
Redzic a8acaea85e Call input.frames() after overwrite confirmation 2021-11-27 22:34:45 -06:00
Redzic 15bf15e720 Call input.frames() after startup_check 2021-11-27 22:33:31 -06:00
Redzic 3abed09a58 Fix incorrect usage of .get(0) for multi progress bar 2021-11-25 13:27:01 -06:00
Redzic 9dec1d681d Resume from initial frames rather than subtract total frame count 2021-11-25 13:07:21 -06:00
Redzic d843bd190f Subtract encoded frames from progress bar on chunk restarts 2021-11-25 13:07:21 -06:00
Redzic 8e81cd95d1 Take &str for fallback parse_aom_vpx_frames 2021-11-25 13:07:21 -06:00
Josh Holmer b3bc876e3a
Fix all clippy warnings as of latest stable rustc (#431)
I kind of wish that we wouldn't use clippy::pedantic and
clippy::nursery, as the number of `allow` lints at the top of src/lib.rs
is becoming quite absurd. However, I at least wanted to clear out the
large set of warnings being issued, regardless of that discussion.
2021-11-25 13:05:24 -06:00
Zen 4de1ba3799 You can encode only --cpu-used=0 2021-11-24 17:45:41 +02:00
redzic e8dac5c44c
Fix mkvmerge for Windows (#429) 2021-11-23 12:57:11 -06:00
redzic 9897290f65 Ensure that ffms2/lsmash exists if specified 2021-11-23 08:01:43 -06:00
redzic af87153259 Remove references to SVT-VP9 in README 2021-11-22 11:01:39 -06:00
redzic 57cbb29306 Remove conditional compilation for ffmpeg concat
The logic should actually be the same on all platforms, Linux
still needs backslashes escaped with another backslash.
2021-11-21 20:34:59 -06:00
redzic dae397117c
Fix ffmpeg concat with spaces or quotes on all platforms (#425) 2021-11-21 20:21:10 -06:00
redzic de5cfda00f
Remove/replace remaining regex parsing code (#424) 2021-11-20 21:49:25 -06:00
redzic 9d6b1157ca
Display the stderr of the ffmpeg pipe when available (#423)
We should ideally still display both the stderr of the source pipe and
the ffmpeg filter pipe, but this should be good enough for the vast
majority of cases as displaying the stderr of both pipes requires a
slightly larger change.
2021-11-20 17:25:13 -06:00
redzic 95d39c8513
Replace regex frame parsing fallback for aom/vpx and rav1e (#422)
Rename the `simd` module to `parse`, as it now contains functions
that do not use SIMD intrinsics.
2021-11-20 15:43:44 -06:00
redzic e25172b5d7 Perform input pixel format check only once
Previously, the pixel format of the input file was checked every time
a chunk was started. Now, we just get the pixel format once at the
beginning and reuse it for all chunks.
2021-11-20 12:55:50 -06:00
redzic 08f0584569 Fix some clippy warnings 2021-11-20 12:08:11 -06:00
redzic 3fd489499d Set Stdio::null() for ffmpeg/vspipe during scene detection
Previously, pressing 'q' during scene detection would cause issues
since it was passed to ffmpeg.
2021-11-20 12:08:11 -06:00
redzic 5a23cc3565
Implement SSE4.1/SSSE3 SIMD-accelerated frame parsing for aomenc/vpxenc (#419)
The SSE4.1/SSSE3 implementation of the parsing routines for
aomenc/vpxenc outperform the old regex by a factor of about 5000x
(3.5 μs vs. 0.7 ns to parse a single line on a Zen 1 1950x).

The idea is to eventually remove regex as a dependency entirely,
especially since there is an open PR to indicatif that speeds up the
template expansion (which replaces regexes with hand-written parsing).
2021-11-20 10:35:31 -06:00
Josh Holmer 65772ba4c7
Enable thin-LTO for release builds (#418)
Although the majority of av1an's time is spent
in third-party binaries, compiling with thin-LTO
does show up to a 10% improvement on scene detection
time. This will cause compilation to be slower.
However, thin-LTO has far less of a compilation time
impact than full LTO, while providing almost the same
speedups.
2021-11-19 12:37:34 -06:00