Currently this only applies to grain synth generation,
but the prior implementation of HDR detection only looked at the props
on the input video. Those may not necessarily be set correctly even if
the user is encoding to HDR, so we want to prioritize looking at the
encoder params, then fallback to checking the input if the user has not
set a transfer characteristic on the encoder.
I can't think of a situation where someone would want this issue to be
ignored, so we should treat it as any other encoder error and perform 3
retries, then exit if it continues to fail. This probably indicates some
kind of issue with decoding or applying filters to that chunk.
* 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
* Add command line arg for sc-only
* added arg to settings.rs
* Add check and kill after split_routine()
Deletes the temporary directory, it would be better if it was never created in the first place.
* Initialize sc_only in EncodeArgs
* cargo fmt
* Integration test
* Make -s a requirement
* cargo fmt
* Add -s as requirement to sc-only via clap
* revert f7688ca
* Fix me not reading errors
* revert db4fb3b
* Cargo fmt
* Added --scenes as a requirement for --sc-only with clap
* Update wording
* Trying to fix the weird integration bug
* Revert 393b380
* Condition on test failure
* Github actions again
* Filename in actions
* Display chunk index instead of worker index in verbose mode
The chunk index would be much more useful for users who are using
verbose mode. Worker index is easily derived from counting the lines,
and is not particularly useful.
* Pass padding around instead of recalculating it
* Add assert and comment
Co-authored-by: Redzic <yusufredzic@gmail.com>
- 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`
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.
This commit mainly changes the behavior in 2 ways:
1. We now get the frame count and do scene detection in parallel. Initially, only the number of processed frames are shown, and the percentage stays at 100%, and the total frame count is 0. When the actual frame count is available, the progress bar is updated to reflect that. This can help I/O bound situations where the source is very large and the frame count takes a long time to calculate.
2. We also generate the vapoursynth cache in parallel with the scene detection and calculating the frame count. This eliminates the pause between scene detection and actual encoding (if vspipe finishes generating the cache in time, which will be the case 99% of the time, and it will still reduce the overhead in the very unlikely case that it hasn't finished yet).
Also fixes bug where vapoursynth input wouldn't work if you specified anything other than lsmash or ffms2 for the chunk method.
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
* 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
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.
- `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.
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.
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.
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.
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.
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).
* Log the command used for concat (activated with log level `debug`)
(the command along with process output is logged again at log level
`error` if the command failed, regardless of `--log-level`)
* Replace some unwraps with `Result`s
* Add more `with_context()`s