CLI
The vidscroll encode command, every option and exactly what it runs.
For a walkthrough, see Pre-encoding with the CLI. This page is the reference.
Usage
Terminal
npx vidscroll encode <input> [output] [options]
npx vidscroll helpArguments and options
| Argument | Default | Meaning |
|---|---|---|
<input> | required | The video to prepare. Any format ffmpeg reads. |
[output] | input name with .scroll.mp4 | Where to write the result. Must differ from the input. An existing file is overwritten. |
–resolution <px> | 720 | Short side of the output. Never enlarges. |
–gop <frames> | 10 | Frames between keyframes. Rounded to a whole number. |
–crf <n> | 22 | Quality, lower is better and bigger. |
–fps <n> | source rate | Frame rate cap. Faster sources are reduced; slower ones keep their rate. |
-h, –help | Show the help text. |
All values must be positive numbers, written after a space (--crf 24, not
--crf=24). Unknown options are ignored.
What it runs
The command calls ffmpeg with these settings:
| Setting | Value |
|---|---|
| Video codec | H.264 (libx264), preset slow, yuv420p |
| Keyframes | Exactly every –gop frames, scene-cut keyframes off |
| Quality | –crf |
| Size | Short side scaled to –resolution or less |
| Frame rate | Capped at –fps when given |
| Audio | Removed |
| Streaming | Metadata at the start of the file (+faststart) |
When it finishes, it prints the output path, its size, the input’s size and the keyframe interval.
Finding ffmpeg
The first one that exists is used:
- the
FFMPEG_PATHenvironment variable, - the
ffmpeg-staticpackage, if installed, ffmpegon yourPATH.
If none is found, the command stops with instructions.
Related
- Pre-encoding with the CLI: choosing settings, sizes and build steps.
- Why seeking stutters: what the keyframe settings change.