npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@efinixit/video-encoder

v1.1.0

Published

Professional video encoder CLI for HLS streaming with multi-resolution support

Readme

EFINIX Video Encoder

╔══════════════════════════════════════════════════════════════════╗
║  ███████╗███████╗██╗███╗   ██╗██╗██╗  ██╗                         ║
║  ██╔════╝██╔════╝██║████╗  ██║██║╚██╗██╔╝                         ║
║  █████╗  █████╗  ██║██╔██╗ ██║██║ ╚███╔╝                          ║
║  ██╔══╝  ██╔══╝  ██║██║╚██╗██║██║ ██╔██╗                          ║
║  ██║     ███████╗██║██║ ╚████║██║██╔╝ ██╗                         ║
║  ╚═╝     ╚══════╝╚═╝╚═╝  ╚═══╝╚═╝╚═╝  ╚═╝                         ║
║                                                                  ║
║     ▓▓▓▓▓  I T    L A B S      ▓▓▓▓▓                             ║
║                                                                  ║
║     Professional Video Encoding Platform                         ║
║     HLS Streaming • Multi-Resolution • High Performance          ║
╠══════════════════════════════════════════════════════════════════╣
║  © 2024 EFINIX IT Labs. All rights reserved.                     ║
║  Version 1.0.0 | Licensed under MIT                              ║
╚══════════════════════════════════════════════════════════════════╝

Professional video encoder CLI for HLS streaming with multi-resolution support. Built by EFINIX IT Labs.

Features

  • HLS Streaming: Generates standard HLS playlists compatible with all major players
  • Multi-Resolution: Automatic encoding to 240p through 1080p
  • Configurable Segments: Set segment duration from 2-10 seconds
  • Multiple Codecs: Support for H.264, H.265 (HEVC), and VP9
  • Progress Tracking: Real-time progress bars for each resolution
  • Preset Control: Fine-tune encoding speed vs quality trade-offs
  • Professional Output: Properly formatted master playlists with bandwidth estimation

Prerequisites

  • Node.js 18 or higher
  • FFmpeg 4.4 or higher (with libx264, libx265, or libvpx)

Installing FFmpeg

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

macOS:

brew install ffmpeg

Windows: Download from ffmpeg.org and add to PATH.

Installation

# Install globally
npm install -g @efinixit/video-encoder

# Or use with npx (no install)
npx @efinixit/video-encoder -i video.mp4

Usage

Interactive Mode (Recommended)

Run without arguments to launch the interactive wizard:

efinix-encode
# or explicitly
efinix-encode --interactive

Interactive mode guides you through:

  • 📹 Video file selection - Browse recent videos or enter a path
  • 📁 Output directory - Create new or select existing directory
  • ⏱️ Segment duration - Choose from presets (2s, 4s, 6s, 8s, 10s) or custom
  • 📐 Resolution preset - Select from predefined packages or custom multi-select
  • Encoding preset - Speed vs quality trade-off
  • 🔵 Codec selection - H.264, H.265, or VP9

Basic Usage (CLI Mode)

efinix-encode -i input.mp4 -o ./output

Advanced Options

efinix-encode \
  -i input.mp4 \
  -o ./encoded \
  -s 6 \
  -r hd \
  -p medium \
  -c libx264

CLI Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --input | -i | Input video file path (required) | - | | --output | -o | Output directory | ./encoded | | --segment-duration | -s | HLS segment duration (2-10 seconds) | 6 | | --resolutions | -r | Resolution preset (all, hd, sd, mobile, minimal) | all | | --custom-res | - | Custom resolutions (e.g., "720p,480p,360p") | - | | --preset | -p | Encoding speed preset | medium | | --codec | -c | Video codec (libx264, libx265, libvpx-vp9) | libx264 | | --audio-codec | - | Audio codec (aac, mp3, opus) | aac | | --fps | - | Target frame rate | Source | | --threads | - | Encoding threads | Auto | | --overwrite | - | Overwrite existing files | false | | --no-banner | - | Suppress startup banner | false | | --list-presets | - | Show available resolution presets | - | | -I, --interactive | - | Run interactive mode | - |

Resolution Presets

Use --list-presets to see available options:

efinix-encode --list-presets

Available Presets:

| Preset | Resolutions | Use Case | |--------|-------------|----------| | all | 1080p, 720p, 480p, 360p, 240p | Full quality ladder | | hd | 1080p, 720p | HD streaming only | | sd | 480p, 360p, 240p | Standard definition | | mobile | 480p, 360p, 240p | Mobile-optimized | | minimal | 360p, 240p | Low bandwidth |

Segment Duration Options

| Duration | Use Case | Best For | |----------|----------|----------| | 2 seconds | Low latency streaming | Live sports, real-time | | 4 seconds | Fast streaming | News, events | | 6 seconds | Balanced (Recommended) | General purpose | | 8 seconds | Efficient packaging | Movies, series | | 10 seconds | Movie/VOD | Long-form content | | Custom | 2-10 seconds | Specific requirements |

Encoding Speed Presets

| Preset | Use Case | |--------|----------| | ultrafast | Draft encoding, fastest | | superfast | Quick previews | | veryfast | Fast encoding | | faster | Good balance for speed | | fast | Recommended for speed | | medium | Default, good balance | | slow | Better compression | | slower | High quality | | veryslow | Best compression, slowest |

Examples

Encode with 4-second segments for live streaming

efinix-encode -i video.mp4 -s 4 -r hd

Custom resolutions only

efinix-encode -i video.mp4 --custom-res "1080p,720p,480p"

High-quality encoding (slow)

efinix-encode -i video.mp4 -p slow -c libx265

Mobile-only with small segments

efinix-encode -i video.mp4 -r mobile -s 4

Output Structure

encoded/
├── master.m3u8              # Master playlist
├── 1080p/
│   ├── playlist.m3u8        # Variant playlist
│   ├── segment_000.ts       # Video segments
│   ├── segment_001.ts
│   └── ...
├── 720p/
│   ├── playlist.m3u8
│   └── ...
└── [other resolutions]...

Serving HLS Content

After encoding, serve the output directory with any static file server:

# Using npx serve
npx serve ./encoded

# Using Python
python3 -m http.server 8080 -d ./encoded

# Using Node.js http-server
npx http-server ./encoded -p 8080

Then play in any HLS-compatible player:

http://localhost:8080/master.m3u8

Programmatic API

import { VideoEncoder, DEFAULT_RESOLUTIONS } from '@efinixit/video-encoder';

const encoder = new VideoEncoder({
  input: './video.mp4',
  outputDir: './output',
  resolutions: DEFAULT_RESOLUTIONS.filter(r => r.name !== '240p'),
  segmentDuration: 6,
  hlsListSize: 0,
  preset: 'medium',
  codec: 'libx264',
  audioCodec: 'aac',
  overwrite: false,
});

encoder.encode((progress) => {
  console.log(`${progress.resolution}: ${progress.percent}%`);
}).then(result => {
  console.log('Complete:', result);
});

License

Copyright (c) 2024 EFINIX IT Labs. All rights reserved.

This software is licensed under the MIT License.
See LICENSE file for details.

Support