3.9 KiB
3.9 KiB
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
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; omitfileto batch all.mp4in the directory.small [opts] [file]: Alias forresize(defaults to 960x540@29.97).rotate <90cw|90ccw|180> [resize opts] [file]: Rotate then resize; omitfileto batch all.mp4.trim <start> [end] <file>: Trim then (optionally) resize; outputsbasename_START-END.mp4(same naming ascut) at source size by default.speedup <2x|4x> [file]: Speed video/audio; outputs*_2x.mp4or*_4x.mp4. Nofilemeans batch all.mp4.merge [out]: Concat all*.mp4intomerged.mp4(or custom name); always processes all.mp4in the directory.cut <start> [end] <file>: Lossless segment copy (no re-encode).interpolate60 [file]: Motion interpolation to 60fps; omitfileto batch all.mp4; outputs*_60fps.mp4.h265 [file]: Transcode to H.265, keep resolution, copy audio, safe subtitles; omitfileto 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(default30000/1001; empty keeps source)--bitrate BR(default 2500k for HW encode)--codec NAME(libx264default, orh264_videotoolbox)--audio MODE(aacdefault,copy, ornone)--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-audiosetsRES_AUDIO=noneand 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. noaudiostream-copies video and drops audio without resizing.- Presets set their own suffixes as noted above.
- Finder uses
ffprobeto avoid brittle grep parsing. - Except for
merge,trim,cut, andfind, providing a single mp4 limits processing to that file; omit it to process all.mp4in the directory. - Existing outputs prompt for overwrite;
--overwrite(where available) auto-accepts.
Dependencies
- FFmpeg/ffprobe in PATH (
brew install ffmpegon macOS).