# Create VOD 🎬 πŸ‡·πŸ‡Ί Russian README: https://gromlab.ru/vod/create-vod/src/branch/master/README_RU.md CLI tool to convert videos to DASH and HLS with hardware acceleration (NVENC / Intel QSV / AMD AMF / VAAPI), adaptive streaming, and automatic thumbnails/poster. Formats are always DASH + HLS. **Features:** - ⚑ Hardware acceleration: auto-detect encoder/decoder (NVENC / Intel QSV / AMD AMF / VAAPI / CPU) - 🎯 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 ## Quick Start ```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 ``` **System requirements:** ```bash # Arch Linux sudo pacman -S ffmpeg gpac # Ubuntu/Debian sudo apt install ffmpeg gpac # macOS brew install ffmpeg gpac ``` **Output:** A folder `video/` in the current directory with segments under `{profile}-{codec}/`, DASH/HLS manifests in the root, poster, and thumbnail sprite/VTT (both DASH and HLS are always generated). ## CLI Usage ```bash create-vod [output-dir] [-r resolutions] [-c codec] [-p poster-timecode] ``` ### Main arguments | Argument | Description | Default | Required | |---------------|------------------------------|---------|----------| | `input-video` | Path to input video file | - | βœ… | | `output-dir` | Output directory | `.` | ❌ | ### Options | Option | Description | Values / Format | Default | Example | |--------|----------------------------|----------------------------|----------|---------------------------------| | `-r, --resolutions` | Quality profiles | `360`, `720@60`, `1080-60` | auto | `-r 720,1080,1440@60` | | `-c, --codec` | Video codec(s) | `h264`, `av1` (comma/space separated) | `h264` | `-c h264,av1` | | `-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` | ### Examples ```bash # Default (DASH + HLS, auto profiles) create-vod video.mp4 # Custom output directory create-vod video.mp4 ./output # Selected resolutions create-vod video.mp4 -r 720,1080,1440 # High FPS create-vod video.mp4 -r 720@60,1080@60 # Poster from 5th second create-vod video.mp4 -p 5 # 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 # Combined parameters create-vod video.mp4 ./output -r 720,1080@60,1440@60 -p 00:00:10 ``` ### Supported resolutions | 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| High FPS (60/90/120) are generated only if the source supports that FPS. ## Defaults & Automation - Segment duration: 2 seconds - Hardware accel: auto-detect best encoder/decoder (GPU if available, else CPU) - 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 - AV1: enabled only if hardware AV1 encoder detected (in auto mode); otherwise остаётся H.264 **Requirements:** Node.js β‰₯18.0.0, FFmpeg, MP4Box (gpac), optional NVIDIA/Intel/AMD GPU for acceleration