71 lines
3.9 KiB
Markdown
71 lines
3.9 KiB
Markdown
# ffsuper.sh — FFmpeg helper
|
|
|
|
`ffsuper.sh` is a Swiss-army FFmpeg helper that wraps common batch operations: resize presets, custom resizes, rotation, trimming, speedup, merge, lossless cut, 60fps interpolation, H.265 transcode, and simple finders.
|
|
|
|
## Quick start
|
|
```bash
|
|
chmod +x ffsuper.sh
|
|
./ffsuper.sh help
|
|
./ffsuper.sh examples
|
|
```
|
|
|
|
## Subcommands
|
|
- `preset <name>` (or call the preset name directly): `medium|medium60|medium5994|large|large60|small60|resize60|default|noaudio|noaudio-small|169to43|43to169`.
|
|
- `resize [opts] [file]`: Custom resize with audio; omit `file` to batch all `.mp4` in the directory.
|
|
- `small [opts] [file]`: Alias for `resize` (defaults to 960x540@29.97).
|
|
- `rotate <90cw|90ccw|180> [resize opts] [file]`: Rotate then resize; omit `file` to batch all `.mp4`.
|
|
- `trim <start> [end] <file>`: Trim then (optionally) resize; outputs `basename_START-END.mp4` (same naming as `cut`) at source size by default.
|
|
- `speedup <2x|4x> [file]`: Speed video/audio; outputs `*_2x.mp4` or `*_4x.mp4`. No `file` means batch all `.mp4`.
|
|
- `merge [out]`: Concat all `*.mp4` into `merged.mp4` (or custom name); always processes all `.mp4` in the directory.
|
|
- `cut <start> [end] <file>`: Lossless segment copy (no re-encode).
|
|
- `interpolate60 [file]`: Motion interpolation to 60fps; omit `file` to batch all `.mp4`; outputs `*_60fps.mp4`.
|
|
- `h265 [file]`: Transcode to H.265, keep resolution, copy audio, safe subtitles; omit `file` to batch all `.mp4`.
|
|
- `find <hevc|60fps|large|medium>`: Probe current dir and list matching files.
|
|
- `help`, `examples`.
|
|
|
|
## Common examples
|
|
- Default resize (960x540@29.97): `./ffsuper.sh resize` (options below)
|
|
- `./ffsuper.sh medium` → `*_medium.mp4` (1280x720@29.97).
|
|
- `./ffsuper.sh medium60` → `*_medium_60fps.mp4` (1280x720@60).
|
|
- `./ffsuper.sh resize60` → `*_60fps.mp4` (960x540@60).
|
|
- `./ffsuper.sh large` → `*_large.mp4` (1920x1080@29.97).
|
|
- `./ffsuper.sh large60` → `*_large_60fps.mp4` (1920x1080@60).
|
|
- `./ffsuper.sh small` → `*_resized.mp4` (960x540@29.97; alias of resize).
|
|
- `./ffsuper.sh small60` → `*_60fps.mp4` (960x540@59.94, ~7M).
|
|
- `./ffsuper.sh 169to43` → `*_aspectfixed.mp4` (force 4:3).
|
|
- `./ffsuper.sh 43to169` → `*_aspectfixed.mp4` (force 16:9).
|
|
- `./ffsuper.sh noaudio input.mp4` → `*_noaudio.mp4` (drop audio only, copy video, keep resolution).
|
|
- `./ffsuper.sh resize --no-audio` → `*_noaudio.mp4`.
|
|
- `./ffsuper.sh rotate 90cw` → `*_rotated.mp4`.
|
|
- `./ffsuper.sh rotate 180` → `*_rotated.mp4` (180° flip).
|
|
- `./ffsuper.sh merge myjoined.mp4` → concat all mp4s.
|
|
- `./ffsuper.sh cut 00:01:00 00:02:00 input.mp4` → lossless slice.
|
|
- `./ffsuper.sh h265 input.mp4` → H.265 output, same resolution.
|
|
|
|
## Resize options (used by resize/rotate and presets)
|
|
- `--width N` (default 960)
|
|
- `--height N` (default 540)
|
|
- `--fps F` (default `30000/1001`; empty keeps source)
|
|
- `--bitrate BR` (default 2500k for HW encode)
|
|
- `--codec NAME` (`libx264` default, or `h264_videotoolbox`)
|
|
- `--audio MODE` (`aac` default, `copy`, or `none`)
|
|
- `--audio-br BR` (default 160k)
|
|
- `--suffix STR` (default `_resized`, overridden by some commands/presets)
|
|
- `--overwrite` (clobber outputs)
|
|
- `--dry-run` (print commands only)
|
|
- `--force-aspect R` (e.g., 4:3 or 16:9, applies setdar)
|
|
- `--no-audio` sets `RES_AUDIO=none` and default suffix `_noaudio`.
|
|
|
|
## Notes and behaviors
|
|
- Rotation defaults to suffix `_rotated`.
|
|
- Trim keeps source resolution unless you pass explicit `--width/--height`.
|
|
- Trim output naming matches `cut`: `basename_START-END.mp4`.
|
|
- `noaudio` stream-copies video and drops audio without resizing.
|
|
- Presets set their own suffixes as noted above.
|
|
- Finder uses `ffprobe` to avoid brittle grep parsing.
|
|
- Except for `merge`, `trim`, `cut`, and `find`, providing a single mp4 limits processing to that file; omit it to process all `.mp4` in the directory.
|
|
- Existing outputs prompt for overwrite; `--overwrite` (where available) auto-accepts.
|
|
|
|
## Dependencies
|
|
- FFmpeg/ffprobe in PATH (`brew install ffmpeg` on macOS).
|