UNPKG

ffmpeg-generator

Version:

Generate multi-resolution FFmpeg HLS commands from any .mp4 file via a smart CLI. Auto-detects streams, builds playlists, and speeds up your video pipeline.

82 lines (57 loc) โ€ข 2.76 kB
Generate multi-resolution FFmpeg HLS commands from any .mp4 file via a smart CLI. Auto-detects streams, builds playlists, and speeds up your video pipeline. <h1 align="center">๐ŸŽฌ ffmpeg-generator</h1> <p align="center">CLI tool to generate high-quality FFmpeg HLS commands โ€” fast, smart, and stream-ready โšก</p> <p align="center"> <a href="https://www.npmjs.com/package/ffmpeg-generator"> <img src="https://img.shields.io/npm/v/ffmpeg-generator?color=blue" alt=""/> </a> <img src="https://img.shields.io/npm/dw/ffmpeg-generator?color=green" alt=""/> <img src="https://img.shields.io/badge/ffmpeg-powered-ff0000?logo=ffmpeg&logoColor=white" alt=""/> </p> ## โšก What is `ffmpeg-generator`? `ffmpeg-generator` is a fast, developer-friendly CLI tool to **generate and run complex FFmpeg commands** for HLS transcoding. It auto-scales videos to multiple resolutions, handles audio streams, and outputs a fully functional `master.m3u8` playlist โ€” ready for streaming ๐Ÿš€ --- ## โœจ Features - ๐Ÿ“ฆ Converts `.mp4` to multi-quality `.m3u8` (HLS) - ๐Ÿ” Auto-detects video resolution & audio index - ๐Ÿ“‚ Smart directory structure with confirmation prompts - ๐Ÿง  Built-in presets for: - 2160p, 1440p, 1080p, 720p, 480p, 360p - ๐Ÿงช Built-in `ffprobe` checks before processing - ๐Ÿ’ฌ Interactive CLI with `inquirer` - โ˜๏ธ Perfect for streaming servers, encoding queues, media tools - ๐Ÿ–ผ๏ธ Optional logo watermark overlay on all resolutions (`--logo`) - ๐Ÿš€ Customizable FFmpeg encoding preset speed (`--speed`) Supports: `placebo`, `slow`, `medium`, `fast`, `faster`, `veryfast` (default), `superfast`, `ultrafast` - โฑ๏ธ Adjustable segment duration with `--hls-time` option (default: `6` seconds) --- ## ๐Ÿง‘โ€๐Ÿ’ป Installation โ— Warning: Make sure you have [ffmpeg](https://ffmpeg.org/) installed and available in your PATH. ```bash npm install -g ffmpeg-generator ``` ### ๐Ÿš€ Usage ![usage](https://files.catbox.moe/t1m336.gif) ``` ffgen <input-file> <output-dir> [optional-subfolder] ``` ```bash ffgen input.mp4 output-folder-path ``` ### โ“ FAQ Q: Do I need FFmpeg installed? A: Yes, both ffmpeg and ffprobe must be in your PATH. Q: Is it open-source? A: MIT license. Steal it. Fork it. Build on it. ### ๐Ÿง  Author Built with โค๏ธ by @sirojbek โ€œIf you manually write FFmpeg commands in 2025โ€ฆ you need this CLI and a vacation ๐Ÿ˜ญโ€ ### ๐Ÿ“œ License MIT ยฉ 2025 Feel free to remix, extend, or publish your own variant. ### Contact Linked In: [sirojbekmaqsudov](https://www.linkedin.com/in/sirojbek/) --- Made with โ˜•, bugs, and ffmpeg rage by [Sirojbek](https://github.com/sirojbek), Smash that โญ on [GitHub](https://github.com/SirojbekMaqsudov/ffmpeg-generator) > Devs who know, know.