diff options
Diffstat (limited to 'transcode.sh.1')
| -rw-r--r-- | transcode.sh.1 | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/transcode.sh.1 b/transcode.sh.1 index 7093397..7d39eca 100644 --- a/transcode.sh.1 +++ b/transcode.sh.1 @@ -11,7 +11,8 @@ transcode.sh \- batch transcode helper for media files using ffmpeg is a batch transcoding wrapper around .BR ffmpeg (1) that processes one or more media files in place, replacing each with a -re-encoded version. +re-encoded version unless no-replacement output mode is enabled with +.BR \-\-output\-dir . .PP Encoding parameters are not hard-coded; instead they are supplied by .IR presets , @@ -153,10 +154,23 @@ Copy originals to \fIDIR\fR before replacing them after successful encoding. not. Backups preserve the source file's absolute path below \fIDIR\fR, and existing backup files are not overwritten. .TP +.BR \-\-output\-dir " \fIDIR\fR, " \-\-output\-dir= \fIDIR\fR +Write encoded files below \fIDIR\fR instead of replacing originals. +\fIDIR\fR must already exist; the script exits with a usage error if it does +not. Relative input paths are preserved below \fIDIR\fR, while absolute input +paths are stored without their leading slash. Existing output files are not +overwritten; numeric suffixes such as +.B .1 +or +.B .2 +are appended when needed. +.TP .BR \-l ", " \-\-only\-if\-smaller -After encoding, replace the original only when the new file is strictly -smaller. If the transcoded file is larger the temporary file is removed -and the original is kept unchanged. +After encoding, keep the new output only when it is strictly smaller than the +original. In replacement mode, a larger output is removed and the original is +kept unchanged. In +.BR \-\-output\-dir +mode, a larger output is removed and no encoded copy is kept. .TP .BR \-\-no\-only\-if\-smaller After encoding, replace the original also if the new file is bigger. @@ -275,7 +289,7 @@ which prints every command as it is executed. .B XDG_CONFIG_HOME Base directory for user configuration. Defaults to .BR $HOME/.config . -.SH BACKUPS +.SH BACKUPS AND OUTPUT DIRECTORIES When .BR \-\-backup\-dir is used, backups are only created after @@ -292,6 +306,25 @@ already exists, a numeric suffix such as or .B .2 is appended. +.PP +When +.BR \-\-output\-dir +is used, originals are never replaced, moved, or deleted. Encoded files are +written below the existing output directory. Relative input paths are preserved +(for example, +.I movies/a.mp4 +becomes +.I encoded/movies/a.mp4 +when the output directory is +.IR encoded ), +and absolute input paths are stored without their leading slash. Existing output +files are not overwritten; numeric suffixes are appended as needed. +.PP +.BR \-\-backup\-dir +and +.BR \-\-output\-dir +are compatible. When both are set, the original is copied to the backup +directory and the encoded file is written to the output directory. .SH SIZE REPORT TSV When .BR \-\-size\-report @@ -299,7 +332,7 @@ is enabled, the TSV log uses this schema: .PP .RS .nf -status filename original_bytes new_bytes saved_pct +status input_path output_path original_bytes new_bytes saved_pct .fi .RE .PP @@ -309,7 +342,13 @@ The status column is one of .BR skipped_larger or .BR failed . -Failed rows may leave output-size fields empty when no encoded output exists. +The +.B input_path +field records the original input. The +.B output_path +field records the final encoded path for successful encodes and size-based +skips, and may be empty when no encoded output exists. Failed rows may leave +output-size fields empty when no encoded output exists. .PP .SH FILES .TP @@ -461,6 +500,12 @@ encoding and before replacement. Equivalent to .BR \-\-backup\-dir . CLI \fB--backup-dir\fR takes precedence. .TP +.B [processing] output_dir +String. Existing directory where encoded files are written without replacing +originals. Equivalent to +.BR \-\-output\-dir . +CLI \fB--output-dir\fR takes precedence. +.TP .B [processing] only_if_smaller Boolean. Equivalent to .BR \-\-only\-if\-smaller / \-\-no\-only\-if\-smaller . @@ -547,6 +592,14 @@ transcode.sh \-n \-v my_movie.mkv .fi .RE .PP +Write encoded copies elsewhere without replacing originals: +.PP +.RS +.nf +transcode.sh \-\-preset av1 \-\-output\-dir ./encoded video.mp4 +.fi +.RE +.PP Use a custom preset and only keep the result if it is smaller: .PP .RS |
