2026-01-20 00:56:01 +03:00
|
|
|
|
# Create VOD 🎬
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
🇷🇺 Russian README: https://gromlab.ru/vod/create-vod/src/branch/master/README_RU.md
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-21 10:13:20 +03:00
|
|
|
|
CLI tool to convert videos to DASH and HLS with hardware acceleration (NVENC / Intel QSV / AMD AMF / VAAPI), adaptive streaming, and automatic thumbnails/poster.
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
**Features:**
|
2026-01-20 14:24:51 +03:00
|
|
|
|
- ⚡ Hardware acceleration: auto-detect encoder/decoder (NVENC / Intel QSV / AMD AMF / VAAPI / CPU)
|
2026-01-20 00:56:01 +03:00
|
|
|
|
- 🎯 Formats: DASH and HLS (shared segments)
|
|
|
|
|
|
- 📊 Quality profiles: multiple bitrates/FPS (auto or custom)
|
|
|
|
|
|
- 🖼️ Preview: thumbnail sprite + VTT, poster from the first frame
|
|
|
|
|
|
- ⏱️ Progress: per-profile and overall CLI progress bars
|
|
|
|
|
|
|
2026-01-21 10:13:20 +03:00
|
|
|
|
## Install
|
|
|
|
|
|
For the CLI to work correctly, FFmpeg and MP4Box must be installed in the system.
|
2026-01-20 00:25:55 +03:00
|
|
|
|
```bash
|
|
|
|
|
|
# Arch Linux
|
|
|
|
|
|
sudo pacman -S ffmpeg gpac
|
|
|
|
|
|
|
|
|
|
|
|
# Ubuntu/Debian
|
|
|
|
|
|
sudo apt install ffmpeg gpac
|
|
|
|
|
|
|
|
|
|
|
|
# macOS
|
|
|
|
|
|
brew install ffmpeg gpac
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-21 10:13:20 +03:00
|
|
|
|
## Quick Start
|
|
|
|
|
|
Before running, make sure `FFmpeg` and `MP4Box` are installed (see Install).
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
# Run via npx (no install)
|
|
|
|
|
|
npx @gromlab/create-vod video.mp4
|
|
|
|
|
|
|
|
|
|
|
|
# Or install globally
|
|
|
|
|
|
npm install -g @gromlab/create-vod
|
|
|
|
|
|
create-vod video.mp4
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-22 11:08:26 +03:00
|
|
|
|
**Output:** In the current directory you'll get:
|
|
|
|
|
|
```
|
|
|
|
|
|
video/
|
|
|
|
|
|
├── manifest.mpd # DASH manifest
|
|
|
|
|
|
├── master.m3u8 # HLS master playlist
|
|
|
|
|
|
├── poster.jpg # Poster frame
|
|
|
|
|
|
├── thumbnails.{jpg,vtt} # Sprite + VTT cues
|
|
|
|
|
|
├── audio/ # Audio init + segments (AAC)
|
|
|
|
|
|
├── 1080p/ # H.264 1080p init + segments
|
|
|
|
|
|
├── 720p/ # H.264 720p
|
|
|
|
|
|
├── 480p/ # H.264 480p
|
|
|
|
|
|
├── 360p/ # H.264 360p
|
|
|
|
|
|
├── 1080p-av1/ # AV1 1080p (if av1 selected)
|
|
|
|
|
|
└── ... # Other profiles/codecs as {profile}-{codec}
|
|
|
|
|
|
```
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
## CLI Usage
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-01-22 11:08:26 +03:00
|
|
|
|
create-vod <input-video> [output-dir] [-r resolutions] [-c codec] [-p poster-timecode] [-e encoder] [-d decoder] [-m]
|
2026-01-20 00:25:55 +03:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
### Main arguments
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
| Argument | Description | Default | Required |
|
|
|
|
|
|
|---------------|------------------------------|---------|----------|
|
|
|
|
|
|
| `input-video` | Path to input video file | - | ✅ |
|
|
|
|
|
|
| `output-dir` | Output directory | `.` | ❌ |
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
### Options
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 14:24:51 +03:00
|
|
|
|
| Option | Description | Values / Format | Default | Example |
|
|
|
|
|
|
|--------|----------------------------|----------------------------|----------|---------------------------------|
|
|
|
|
|
|
| `-r, --resolutions` | Quality profiles | `360`, `720@60`, `1080-60` | auto | `-r 720,1080,1440@60` |
|
2026-01-20 14:52:59 +03:00
|
|
|
|
| `-c, --codec` | Video codec(s) | `h264`, `av1` (comma/space separated) | `h264` | `-c h264,av1` |
|
2026-01-20 14:24:51 +03:00
|
|
|
|
| `-p, --poster` | Poster timecode | `HH:MM:SS` or seconds | `00:00:00` | `-p 00:00:05` or `-p 10` |
|
|
|
|
|
|
| `-e, --encoder` | Video encoder | `auto`, `nvenc`, `qsv`, `amf`, `vaapi`, `videotoolbox`, `v4l2`, `cpu` | `auto` | `-e nvenc` |
|
|
|
|
|
|
| `-d, --decoder` | Video decoder (hwaccel) | `auto`, `nvenc`, `qsv`, `vaapi`, `videotoolbox`, `v4l2`, `cpu` | `auto` | `-d cpu` |
|
2026-01-22 11:08:26 +03:00
|
|
|
|
| `-m, --muted` | Disable audio track | flag | off | `-m` |
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
### Examples
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-01-20 14:52:59 +03:00
|
|
|
|
# Default (DASH + HLS, auto profiles)
|
2026-01-20 00:25:55 +03:00
|
|
|
|
create-vod video.mp4
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
# Custom output directory
|
2026-01-20 00:25:55 +03:00
|
|
|
|
create-vod video.mp4 ./output
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
# Selected resolutions
|
2026-01-20 00:25:55 +03:00
|
|
|
|
create-vod video.mp4 -r 720,1080,1440
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
# High FPS
|
2026-01-20 00:25:55 +03:00
|
|
|
|
create-vod video.mp4 -r 720@60,1080@60
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
# Poster from 5th second
|
2026-01-20 00:25:55 +03:00
|
|
|
|
create-vod video.mp4 -p 5
|
|
|
|
|
|
|
2026-01-20 14:24:51 +03:00
|
|
|
|
# Force CPU encode/decode
|
|
|
|
|
|
create-vod video.mp4 -c h264 -e cpu -d cpu
|
|
|
|
|
|
|
|
|
|
|
|
# Force GPU encode + CPU decode
|
|
|
|
|
|
create-vod video.mp4 -c h264 -e nvenc -d cpu
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
# Combined parameters
|
2026-01-20 14:24:51 +03:00
|
|
|
|
create-vod video.mp4 ./output -r 720,1080@60,1440@60 -p 00:00:10
|
2026-01-22 11:08:26 +03:00
|
|
|
|
|
|
|
|
|
|
# No audio
|
|
|
|
|
|
create-vod video.mp4 -m
|
2026-01-20 00:25:55 +03:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
### Supported resolutions
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
| Resolution | Label | FPS options |
|
|
|
|
|
|
|------------|----------------|------------------|
|
|
|
|
|
|
| `360` | 360p (640×360) | 30, 60, 90, 120 |
|
|
|
|
|
|
| `480` | 480p (854×480) | 30, 60, 90, 120 |
|
|
|
|
|
|
| `720` | 720p (1280×720)| 30, 60, 90, 120 |
|
|
|
|
|
|
| `1080` | 1080p (1920×1080)| 30, 60, 90, 120|
|
|
|
|
|
|
| `1440` | 1440p (2560×1440)| 30, 60, 90, 120|
|
|
|
|
|
|
| `2160` | 2160p (3840×2160)| 30, 60, 90, 120|
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
High FPS (60/90/120) are generated only if the source supports that FPS.
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
## Defaults & Automation
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
- Segment duration: 2 seconds
|
2026-01-20 14:24:51 +03:00
|
|
|
|
- Hardware accel: auto-detect best encoder/decoder (GPU if available, else CPU)
|
2026-01-20 00:56:01 +03:00
|
|
|
|
- Profiles: auto-selected based on source resolution
|
|
|
|
|
|
- Bitrate: BPP-based dynamic calculation
|
|
|
|
|
|
- Thumbnails: auto sprite (160×90, 1s interval) + VTT
|
|
|
|
|
|
- Poster: first frame (0:00:00, configurable via `-p`)
|
|
|
|
|
|
- Parallel encoding: enabled
|
2026-01-21 10:13:20 +03:00
|
|
|
|
- AV1: enabled only if hardware AV1 encoder detected (in auto mode); otherwise stays on H.264
|
2026-01-20 00:25:55 +03:00
|
|
|
|
|
2026-01-20 00:56:01 +03:00
|
|
|
|
**Requirements:** Node.js ≥18.0.0, FFmpeg, MP4Box (gpac), optional NVIDIA/Intel/AMD GPU for acceleration
|