Video Commands¶
The max video group wraps FFmpeg. Most commands take an input file and accept -o to set the output path. Without -o, Max writes a new file next to the input and leaves the original alone. Each command below names its default result, where {stem} is the input's name without its extension.
FFmpeg Auto-Resolution¶
Max finds FFmpeg in three steps:
- Check the system PATH (
shutil.which) - Check
~/.max_cli/bin/for a binary it downloaded before - Offer to download a binary for your platform
You don't need to install FFmpeg yourself. To install it ahead of time, run:
Several files at once¶
Every command below except concat, record, stream and preview takes several files, a folder or a pattern as well as one file:
max video compress a.mp4 b.mp4 # these two files
max video compress ~/Videos --recursive # every video in the folder and its subfolders
max video audio-convert "*.m4a" --queue # every M4A here, as background jobs
- A folder gives you its video files.
cut,louder,normalize,denoiseandaudio-converttake its audio files too. Max leaves out hidden files and folders. - Quote a pattern (
"*.m4a") so Max expands it, not your shell. --recursivelooks in subfolders too.- With a folder or a pattern, Max skips a file whose result already exists (
a.mp4whena_compressed.mp4is there) and doesn't treat its own earlier results as new input.--redoruns those files again. Files you name one by one always run.cutskips nothing, so it has no--redo. - Max runs up to four files at a time and ticks off each one as it finishes. When a file fails, the others still run; Max lists the failures at the end and exits with code 1.
-onames one file, so Max refuses it with several. Each result goes next to its file.--queue(every command here exceptsnap) adds one job per file to the background queue and starts a background worker. The worker keeps going after you close the terminal. Runmax queue statusto watch it. See Queue.compressanddenoisealso take-qfor--queue; into-audioandaudio-convert,-qmeans--quality.
compress¶
Compress a video to H.264 MP4, at a quality level or to fit a size.
Options:
-o- Output path (default:{stem}_compressed.mp4)--level-high(CRF 23),balanced(CRF 28) ormax(CRF 35, smallest file). Default:balanced--size- Aim for a file size instead of a level, such as25MBor800KB. Max reads the video's length, works out the bitrate and encodes in two passes, so the result lands just under the size. A tight size gets less sound bitrate and a smaller picture (720p or 480p). If the first try comes out over, Max encodes once more at a lower bitrate. A video already under the size is left alone, and a size too small for the video's length is refused with the smallest size that works--queue,-q- Add the job to the background queue instead of running it now. See Queue.--recursive,--redo- See Several files at once
Examples:
max video compress movie.mp4
max video compress movie.mp4 --level high
max video compress movie.mp4 --level max -o small.mp4
max video compress clip.mp4 --size 25MB # fits a 25 MB upload limit
max video compress movie.mp4 --queue
max video compress ~/Videos --level max
convert¶
Change the video container, for example MKV to MP4.
Max saves the result next to the input as {stem}.{format}. This command has no -o.
Options:
--format,-f- Target format:mp4,mkvoravi(default:mp4)--recursive,--redo,--queue- See Several files at once
to-audio¶
Extract the audio track from a video.
Options:
--format,-f-mp3,wav,flacoraac(default:mp3)--quality,-q-s(96k),m(128k),h(192k) orx(320k). Default:h--output,-o- Output path (default:{stem}.{format})--recursive,--redo,--queue- See Several files at once
Examples:
max video to-audio lecture.mp4
max video to-audio lecture.mp4 --format wav
max video to-audio lecture.mp4 -q x
cut¶
Trim a video. --start is required. Pass --end or --duration, or neither to keep everything up to the end of the file.
Options:
--start,-s- Start time, such as00:01:00or60(required)--end,-e- End time--duration,-d- Length to keep, such as10-o- Output file (default:{stem}_cut.mp4, or{stem}_cut.mp3for an audio file)--recursive,--queue- See Several files at once
Examples:
cut-silence¶
Cut the pauses out of a recording: jump cuts for talks, lectures, tutorials, podcasts and voice notes.
Max finds the stretches quieter than the threshold that last at least --min-silence seconds (FFmpeg's silencedetect), then writes the file without them. Each cut keeps --padding seconds of the pause at both ends, so words don't start or stop abruptly; silence at the very start and end goes completely. Video and sound stay in sync. The result keeps the input's type: talk.mp4 gives talk_nosilence.mp4, note.m4a gives note_nosilence.m4a.
Options:
--threshold,-t- Quieter than this many dB counts as silence (default: -30). Use -40 for a recording made in a quiet room, -25 when there's a hum under the pauses--min-silence,-m- The shortest pause to cut, in seconds (default: 0.6). 1.0 keeps natural breaths--padding,-p- Seconds of each pause to keep at both ends (default: 0.15)-o- Output file (default:{stem}_nosilencewith the input's extension)--queue,-q- Add the job to the background queue--recursive,--redo- See Several files at once
A file with no pauses that long is left alone. A file that is all silence at the threshold is refused, with a lower threshold to try.
Examples:
max video cut-silence lecture.mp4
max video cut-silence podcast.mp3 -t -40 -m 1
max video cut-silence ~/Recordings --queue
concat¶
Join several videos into one.
TARGET is a glob pattern such as "*.mp4", or a text file with one file /path/to/video.mp4 line per video.
Options:
-o- Output file--method,-m-fastcopies the streams without re-encoding. Use it when every input has the same codec and size.safere-encodes and scales every clip to 1920x1080, so it works with mixed inputs. Default:fast
Examples:
gif¶
Turn a video clip into a GIF.
Options:
-o- Output GIF (default:{stem}.gif)--width- Width in pixels; height scales to match (default: 480)--fps- Frames per second (default: 15)--recursive,--redo,--queue- See Several files at once
snap¶
Save a JPG screenshot at a timestamp.
Options:
--time,-t- Timestamp (default:00:00:05)-o- Output image (default:{stem}_thumb.jpg)--recursive,--redo- See Several files at once
louder¶
Raise the volume of a quiet recording.
TARGET can be a video or an audio file.
Options:
--db- Decibels to add (default: 5.0)-o- Output file (default:{stem}_boostedwith the input's extension)--recursive,--redo,--queue- See Several files at once
mute¶
Remove the audio track.
Options:
-o- Output file (default:{stem}_mute.mp4)--recursive,--redo,--queue- See Several files at once
brightness¶
Adjust brightness and contrast.
Options:
--brightness,-b- 0.0 to 2.0, where 1.0 is unchanged (default: 1.0)--contrast,-c- 0.0 to 2.0, where 1.0 is unchanged (default: 1.0)-o- Output file (default:{stem}_adjusted.mp4)--recursive,--redo,--queue- See Several files at once
color¶
Apply a color grading preset.
Options:
--preset,-p-vivid,vintage,noir,warm,coolorfade(default:vivid)-o- Output file (default:{stem}_{preset}.mp4, such astrip_noir.mp4)--recursive,--redo,--queue- See Several files at once
stabilize¶
Smooth out shaky footage.
Options:
-o- Output file (default:{stem}_stabilized.mp4)--recursive,--redo,--queue- See Several files at once
normalize¶
Set the audio loudness to a target level.
TARGET can be a video or an audio file.
Options:
--level,-l- Target loudness in LUFS (default: -20.0)-o- Output file (default:{stem}_normalizedwith the input's extension)--recursive,--redo,--queue- See Several files at once
denoise¶
Remove background noise such as hiss, hum, fans or room noise.
Options:
--mode,-m-auto(general),hiss(constant hiss),hum(low rumble) orspeech(RNNoise, best for voice). Default:auto--strength,-s-mild,mediumoraggressive. Applies toautomode only. Default:medium--output,-o- Output file (default:{stem}_denoisedwith the input's extension)--queue,-q- Add the job to the background queue--recursive,--redo- See Several files at once
Examples:
# Auto mode, medium strength
max video denoise recording.mp4
# Remove constant microphone hiss
max video denoise podcast.mp4 --mode hiss
# Cut low-frequency rumble (AC, traffic)
max video denoise lecture.mp4 --mode hum
# Best for speech and podcasts
max video denoise recording.mp4 --mode speech
# Very noisy audio
max video denoise noisy.mp4 --strength aggressive
# Run it in the background
max video denoise long_clip.mp4 --queue
# Every recording in a folder
max video denoise ~/Recordings --mode speech
Note:
automode uses FFmpeg'sanlmdnfilter, which is CPU-heavy. For faster results, try--mode hissor--mode hum. Max copies the video stream (-c:v copy) and re-encodes only the audio.
audio-convert¶
Convert audio between formats, for example WAV to MP3.
TARGET can be an audio file or a video file.
Options:
--format,-f-mp3,aac,flac,wavorogg(default:mp3)--quality,-q-s(128k),m(192k) orh(320k). Default:h-o- Output file (default:{stem}.{format})--recursive,--redo,--queue- See Several files at once
Example:
record¶
Record your screen. Press Ctrl+C to stop when you don't set a duration.
Options:
OUTPUT- Output file (default:screen recording.mp4)--duration,-d- Recording length in seconds--fps- Frames per second (default: 30)--audio,-a- Include system audio
stream¶
Stream a video file to an RTMP server such as Twitch or YouTube.
Options:
--url,-u- RTMP server URL (required)--bitrate,-b- Video bitrate (default:4500k)--preset,-p- Encoder preset fromultrafasttoslow(default:veryfast)
Example:
preview¶
Serve a video over HTTP as an HLS stream. Open http://localhost:8080/live.m3u8 in a media player to watch.
Options:
--port,-p- HTTP port (default: 8080)--bitrate,-b- Transcoding bitrate (default:2000k)