Commit graph

98 commits

Author SHA1 Message Date
Josh Holmer
11d2b91215
Upgrade to edition 2021 (#610) 2022-04-10 16:46:49 +00:00
Josh Holmer
02ffc86601
Use published ffmpeg-next (#609) 2022-04-10 16:32:03 +00:00
redzic
e5dd06c6dd
Include whether lsmash and ffms2 were found in version info (#606) 2022-04-03 18:37:34 +00:00
Josh Holmer
84d46bb40c
Add zones support (#598)
* 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
2022-03-28 15:23:08 +00:00
Josh Holmer
cfad841648
Disable grain table generation if --photon-noise 0 is set (#599) 2022-03-25 21:04:09 +00:00
redzic
b0bb4687ee
Update dependencies (#589) 2022-03-12 13:37:29 +00:00
redzic
2efb7daa73
Set required for input (#585) 2022-03-08 01:40:33 +00:00
Zen
09e552b413
Multiple input files (#582)
* Multiple input files

* clippy fix

* reset logger for each input file

* remove comment
2022-03-07 14:22:24 +00:00
Zen
f66a805256
Adaptive extra splits (#584)
* Adds adaptive extra splits

* docs

* correction

* squize

* more squize
2022-03-05 12:43:10 +00:00
Jeremy Lee Shields
f5ec4891be
Lastrosade sc only (#574)
* 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
2022-03-02 05:33:31 +00:00
redzic
6634bc77f8
Update to ffmpeg 5.0 (#575)
* Update to ffmpeg 5.0
2022-02-22 22:17:37 +02:00
Josh Holmer
351d19accb
Rework log levels to be more useful (#546)
- 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`
2022-01-18 23:20:01 +00:00
redzic
36fbff1dcd
Update version to 0.3.1 (#541) 2022-01-17 07:16:42 +00:00
redzic
13313cacc1
Re-add concat info to --help (#537) 2022-01-16 21:03:59 +00:00
Zen
7bb1b47eaa 0..3.0 2022-01-06 02:49:36 +02:00
redzic
1b27ef7e28
Remove ctrlc dependency (#509)
* Remove ctrlc dependency

* Update other dependencies
2022-01-04 10:23:00 +00:00
Josh Holmer
dc2d3ebdab
Add a CLI option for changing chunk order (#493)
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.
2022-01-02 05:49:47 +00:00
Josh Holmer
b8397b5a19
Move photon-noise to ENCODING header (#491)
This was missed during the rebase between the photon-noise and clap v3
PRs.
2022-01-02 02:34:36 +00:00
redzic
214adba05b
Migration to clap-v3 (#487) 2022-01-02 01:55:11 +00:00
Josh Holmer
03244e0877
Add option to generate film grain tables for aomenc (#485) 2022-01-01 21:13:03 +00:00
redzic
fb3f38fab7
Remove overhead at the start and in between scene detection and encoding (#473)
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.
2021-12-25 07:34:06 +00:00
Josh Holmer
a9f3fb266e
Regular dependency upgrades (#471) 2021-12-25 03:24:18 +00:00
redzic
7d729a7626
Add more info to --help (#469) 2021-12-24 01:47:59 +00:00
Redzic
d07036dd5e Add unstable to the version info 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
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
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
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
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
redzic
34d991d06d
Delegate chunk starts/finishes to debug log level, other logging changes (#412)
* 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.
2021-11-18 14:06:50 -06:00
redzic
fdef1f4a2d
Use dimmed colors instead of fixed xterm 256 colors (#411) 2021-11-18 08:27:51 -06:00
redzic
db5e569f9d
Adjust CLI output to be more colorful (#407)
* 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
2021-11-17 23:01:46 -06:00
redzic
f94c65f992
Improve logging (especially with --verbose) (#404)
* 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
2021-11-17 10:57:08 +02:00
redzic
637314e7f1
Fix compilation on macos (#403) 2021-11-16 03:42:41 +02:00
redzic
98bb4cc4b6
Allow setting thread affinity for each worker (#402)
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.
2021-11-16 00:15:26 +02:00
redzic
754c1192fe
Always copy subtitles and all audio tracks (#400)
* 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
2021-11-07 14:20:12 +02:00
Zen
a874dec452 av1an 0.2.0 release 2021-10-31 22:56:47 +02:00
redzic
c16f6a2730
Fix vergen for release again (#394) 2021-10-31 22:51:10 +02:00
Zen
5c8a99879f bump av1an-cli version 2021-09-12 22:26:42 +03:00
redzic
eb1047aa30
Fix vergen for release (#393) 2021-10-31 22:20:38 +02:00
Zen
782f74982b Bump version 2021-09-11 21:24:58 +03:00
redzic
e2451684b8
Refactor: Better ffmpeg pipe handling + more info in --version (#389)
* 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
2021-10-30 14:49:26 +03:00
Josh Holmer
c8547c7c9b
Changes for rav1e's hybrid scene detection update (#381) 2021-10-14 02:04:11 +03:00
redzic
3147a942a7
Reduce piping overhead to encoder in certain situations (#379)
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.
2021-10-13 05:21:55 +03:00
redzic
e9ef27f524
Perform startup check before confirming output file overwrite (#377) 2021-10-09 14:07:21 +03:00
redzic
f5c3b3c85a
Fix many clippy warnings, many small code style changes (#375) 2021-10-05 20:08:18 +03:00