diff options
| author | Dennis Fink | 2026-05-16 08:42:23 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-05-16 08:42:23 +0200 |
| commit | 4bb37025cf1b4516acd2746dc60ec59449e8aab0 (patch) | |
| tree | 7400b97260859dff50488b9653c5f111ae8211c9 | |
| parent | 13b50b5faae3d46e1b23ccc4922b098b7feaf709 (diff) | |
| download | transcode.sh-4bb37025cf1b4516acd2746dc60ec59449e8aab0.tar.gz transcode.sh-4bb37025cf1b4516acd2746dc60ec59449e8aab0.zip | |
fix: allow out-of-range nice adjustments
Keep nice validation focused on accepting integer values instead of
rejecting values outside the standard -20 to 19 range.
Avoid failing early for values that nice itself accepts and clamps
internally. This gives users behavior that matches the underlying tool
instead of turning a non-error into a transcode.sh usage error.
Update help text and README wording to describe the option as a nice
adjustment, matching the command behavior.
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | transcode.sh | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -195,7 +195,7 @@ transcode.sh [OPTION] [--] FILE... | `--config-file FILE`, `--config-file=FILE` | Load configuration from FILE instead of the default path | | `-f PATH`, `--encode-file PATH`, `--encode-file=PATH` | Read file list from PATH (one per line) | | `-n`, `--dry-run` | Show what would be done; don't run ffmpeg | -| `-N VALUE`, `--nice VALUE`, `--nice=VALUE` | Niceness value for ffmpeg (default: 19) | +| `-N VALUE`, `--nice VALUE`, `--nice=VALUE` | Nice adjustment for ffmpeg (default: 19) | | `--hwaccel [METHOD]`, `--hwaccel=METHOD` | Enable hardware acceleration; METHOD defaults to `auto` if omitted (e.g. `cuda`, `vaapi`, `videotoolbox`); enabled by default | | `--no-hwaccel` | Disable hardware acceleration (omit `-hwaccel` from ffmpeg invocation) | | `-s`, `--size-report` | Print per-file size feedback and write a status TSV log | diff --git a/transcode.sh b/transcode.sh index 33794bf..b88c9d8 100755 --- a/transcode.sh +++ b/transcode.sh @@ -279,7 +279,7 @@ Long options that take a value also accept ${BOLD}${YELLOW}--option${ALL_OFF}${B ${BOLD}${BLUE}Encoding options:${ALL_OFF} ${BOLD}${YELLOW}-p, --preset${ALL_OFF} ${BOLD}${GREEN}NAME${ALL_OFF} load ffmpeg arguments from a preset (default: ${BOLD}${RED}%s${ALL_OFF}) - ${BOLD}${YELLOW}-N, --nice${ALL_OFF} ${BOLD}${GREEN}VALUE${ALL_OFF} nice value for ffmpeg (default: ${BOLD}${RED}%d${ALL_OFF}) + ${BOLD}${YELLOW}-N, --nice${ALL_OFF} ${BOLD}${GREEN}VALUE${ALL_OFF} nice adjustment for ffmpeg (default: ${BOLD}${RED}%d${ALL_OFF}) ${BOLD}${YELLOW}-n, --dry-run${ALL_OFF} show what would be done, do not run ffmpeg ${BOLD}${YELLOW} --hwaccel${ALL_OFF} ${BOLD}${GREEN}[METHOD]${ALL_OFF} enable hardware acceleration; METHOD defaults to ${BOLD}${RED}auto${ALL_OFF} if omitted @@ -1527,8 +1527,8 @@ if [[ $_CLI_SIZE_REPORT_FILE -eq 1 && $SIZE_REPORT -eq 0 ]]; then warn "--size-report-file has no effect without --size-report" fi -if [[ ! "$NICE_VALUE" =~ ^-?[0-9]+$ || $NICE_VALUE -lt -20 || $NICE_VALUE -gt 19 ]]; then - error "Invalid nice value (must be an integer between -20 and 19):" "$NICE_VALUE" +if [[ ! "$NICE_VALUE" =~ ^-?[0-9]+$ ]]; then + error "Invalid nice value (must be an integer):" "$NICE_VALUE" exit $EXIT_USAGE_ERROR fi |
