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

file-to-video-cli

v1.0.0

Published

Convert perfectly any file into a video and decode it back, with support for Lossless and YouTube redundancy modes.

Readme

File-to-Video-CLI

A robust tool for archiving files as video.

Securely convert any file (PDF, ZIP, DOCX, binary, etc.) into a playable video format for cloud backup or data transfer. This tool employs advanced error correction to mathematically guarantee bit-perfect file reconstruction. Even when uploaded to platforms with harsh lossy video compression, your original data is safely preserved and easily retrievable.

Why?

Most "file to video" implementations simply map one byte to one pixel. This approach permanently destroys the file the second it is uploaded to a video platform due to H.264/VP9 compression.

By using massive Macro-Blocks and Triple Modular Redundancy (TMR) error correction, this tool ensures your file can survive the harsh compression algorithms of modern streaming sites without losing a single bit of original data.

Architecture

This project features TWO distinct operational modes tailored to different environments. Both modes utilize a strict 512-byte payload header containing Magic Bytes (FVFB), size, filename, and a SHA-256 checksum to guarantee correct extraction. alt text

1. Lossless Mode (--mode lossless)

  • Purpose: Local archive storage, peer-to-peer transfer, and native file-system hoarding.
  • Pixel Mapping: 1 Byte = 1 RGB Pixel.
  • Codec: Uses the lossless FFV1 codec.
  • Why it works: Because no lossy compression is applied, the exact RGB values written are the exact RGB values read. This results in the smallest possible video file for a given payload, but it will not survive upload to streaming platforms like YouTube.

2. YouTube Mode (--mode youtube)

  • Purpose: Cloud storage using video streaming platforms (YouTube, Vimeo, etc.).
  • Pixel Mapping: 1 Bit = 8x8 Pixel Macro-Block (Black = 0, White = 1).
  • Error Correction: Uses Triple Modular Redundancy (TMR). Every single bit of data is written 3 times.
  • Codec: Uses the highly compressed H.264 codec.
  • Why it works: Streaming platforms aggressively compress videos using lossy algorithms, blurring pixels together. By using massive 8x8 blocks, the decoder can sample the center of the block and read the luminance. Even if compression significantly degrades the edges or drops frames, the mathematical TMR majority-voting allows the exact byte stream to be perfectly reconstructed.

Prerequisites

  • Node.js (v18+)

All encoding and decoding logic, including FFmpeg binaries, are self-contained using ffmpeg-static. No external FFmpeg installations are required.

CLI Usage

If you installed the package globally (npm i -g file-to-video-cli), you can use the f2v command directly. Alternatively, you can run npx file-to-video-cli.

npm i -g file-to-video-cli

Encode

Converts a target file to a video format:

# YouTube Mode (Default - Generates a highly redundant, compression-resistant MP4)
f2v encode --mode youtube --input ./my-file.zip --output ./encoded.mp4

# Lossless Mode (Generates a mathematically perfect, small MKV for local storage)
f2v encode --mode lossless --input ./my-file.zip --output ./encoded.mkv

Decode

Reads the encoded video, validates it using the integrated SHA-256 checksum, and perfectly reconstructs the original file:

# Decoding YouTube
f2v decode --mode youtube --input ./encoded.mp4 --output ./out_directory

# Decoding Lossless
f2v decode --mode lossless --input ./encoded.mkv --output ./out_directory