* Fix formatting of zones help text
* Fix issue where wrong number of frames are read in scenechange with zones active
* Fix scenechange progress bar when zones active
* Add zones support
Currently implemented:
- Overriding the selected encoder & number of passes
- Overriding or adding video params
- Overriding photon noise setting
- Overriding min/max scene length
Closes#267
* Error if zoned encoder does not support output pixel format
* Fix crash if zones change number of passes
* Set passes to 1 for zones with rt mode
- Update log levels so that the log file contains more verbose
information by default, while leaving the stderr progress indicator
relatively uncluttered
- Explicitly set the log level to `error` for all dependencies
- rav1e scenechange info has been moved to `--log-level trace`
- Avoid outputting colors if stderr is not a tty
- Fix a crash when using `--quiet`
* Use latest indicatif release
* Fix some clippy lints
* Also validate formatting and warnings in CI
* Minor dependency updates
* Do not show '/0' frames if we haven't computed frame count yet
People have been requesting this because the default chunk order tends
to skew toward underestimating the final filesize. Longest first is kept
as the default because it provides the best performance.
* 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>
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.
* Replace panic with error return
* Replace last regex with hand written parser
* Update dependencies
* Fix clippy warnings
* Adjust idx check
* More idiomatic rust
- `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.
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).
* Rename `--logging` to `--log-file` (`-l` shorthand still works)
* Introduce new `--log-level` option to set the log level filter
This change makes `--verbose` not log chunk starts and finishes, and
that information is not logged in the log file either unless
`--log-level=debug` is set. By default, `--log-level` is set to `info`.
The `debug` log level also logs the rav1e scenechange decision info
for each frame.
* Adjust verbose progress style for workers
* Also add `-y` flag to overwrite output file without confirmation
* Update dependencies
* Fix compilation on older versions of rustc
* Improve logging (especially with `--verbose`)
Much more information is now logged when using `--verbose` (all INFO
messages), and the output is also much cleaner.
The issue of logs being hidden while the progress bar is active
because of conflicting ANSI escape codes has been completely fixed, and
no more undesirable hacks are required to correctly display the
set_thread_affinity warning message correctly, for example. This has
been achieved by using indicatif's `println` function instead of just
printing to stderr directly.
flexi_logger has been moved to av1an-cli as it should be, since a
logging framework that actually prints things and handles log level
filtering is not the responsibility of the core library. However, the
actual progress bar code with indicatif still lives in av1an-core for
now.
* Make `--quiet` conflict with `--verbose`
* Fix resuming and improve error handling slightly
Introduces a new command line option called `--set-thread-affinity=n`,
where `n` specifies the number of threads to assign to each worker.
We use the `affinity` crate instead of the `nix` crate directly to
get abstractions for Windows and Linux.
The main change that this commit introduces is an `EncoderCrash` type
for errors, which also reports the stderr of the process piping to
the encoder so that it is easier to tell what the actual error is.
Target quality probe crashes are now properly logged with the
`EncoderCrash` type, replacing the old panicking code and making the
error significantly easier to read.
An "optimization" has been implemented which does not wait for the child
process piping to the encoder to exit, and instead collects its stderr
output asynchronously and immediately exits upon an encoder crash. This
does not yet apply to target quality probes, as there is not yet a
single interface for running an encoder (it is done manually for now).
This will change in the future, but this patch is getting too big for
everything so for now we just capture stderr synchronously for target
quality probes.
- Also update `get_percentile` to use an O(N) algorithm from the
standard library instead of O(N*log N).
* Always copy subtitles and all audio tracks
Require mkvmerge for x265
* cargo update
* Fix concat if audio file does not exist
* Use stable rustc in Docker, do not compile VVC
* Use old Docker image for now which works with vapoursynth
* Fix tests.yml
* Use mkvmerge for tests
* Add mkvtoolnix as a dependency in tests.yml
* Refactor: Better ffmpeg pipe handling + more info in --version
* Update dependencies
* Better documentation in `--help`
* Include git commit hash and more info in `--version`
* Add `-k` as shorthand for `--keep`
* Do not pass `ffmpeg_pipe` around everywhere
* Use macro to generate encoder bit depth functions
* Fix documentation in README
* Fix some clippy warnings
Previously, we always piped the chunk method into FFmpeg
to apply filters and convert the pixel format, but this
just adds unnecessary overhead if there is no FFmpeg filter
specified and if the pixel format of the source and encode
are the same. So, in that situation, we now pipe the chunk
method directly into the encoder instead. This should
nicely speed things up a bit (and possibly reduce memory
consumption).
Additionally, `--pix-format` is now verified using the FFmpeg
API when the CLI args are parsed, making it impossible to
accidentally specify an incorrect format. Previously, there
were no checks at all, so if you specified the wrong format it
would just fail during the encoding process with no obvious
indication of the root cause.
This does not apply to vapoursynth input for now, as that
would be slightly more complicated since it has a different
API for getting the pixel format.