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 🙏

© 2024 – Pkg Stats / Ryan Hefner

datamosh-cli

v2.1.0

Published

A CLI tool to datamosh videos

Downloads

31

Readme

datamosh-cli

A command-line tool to break files.

What the hell is datamoshing?

Long story short, it’s the act of modifying digital files in such a way that they create artifacts for aesthetic pleasure. See Compression Artifact on Wikipedia.

Installation

If you want to use datamosh-cli in a project, you can install it as a project dependency:

npm install datamosh-cli

If you want to use it on your computer instead, you can either install the package globally:

npm install -g datamosh-cli

Or use npx to download the package automatically and run it:

npx -p datamosh-cli datamosh [command] [options]

Usage

datamosh [command] <source> <destination> [options] [-- ffmpeg arguments]

ffmpeg-static is used to convert various formats to corruptable formats. Consequently, <source> and <destination> can be whatever format ffmpeg gets. You can pass additional settings (like encoding, compression, etc) after the -- argument:

datamosh all stickers.mp4 stickers-destroyed.mp4 -- -c:v libx264

Additional parameters to ffmpeg might clash with what datamosh tries to do, so use with caution.

datamosh all <source> <destination> [options]

Option | Default value | Description ------------------|---------------|-------------------------------------------------------------------- --overwrite | - | Skips overwrite prompt and overwrites <destination> if it exists

The all command runs all commands in the following order:

  1. remove-keyframes
  2. shuffle-frames

Example

datamosh all examples/stickers.mp4 examples/stickers-all.gif -- -filter_complex 'fps=15'

datamosh remove-keyframes <source> <destination> [options]

Option | Default value | Description ------------------|---------------|-------------------------------------------------------------------- --frame-offset | -1 | Offset to start looking for neighbouring frames --overwrite | - | Skips overwrite prompt and overwrites <destination> if it exists

The remove-keyframes command replaces keyframes (I-frames) with delta frames (B/P-frames), resulting in the pixel of one scene leaking into to next, similar to the music video of A$AP Mob - Yamborghini High. The first keyframe is preserved. When replacing keyframe n, datamosh-cli starts at frame n + frameOffset and loops back in time until it finds a delta frame. This means that a positive frame offset can be used to cause (intentional) stuttering.

Example

datamosh remove-keyframes examples/stickers.mp4 examples/stickers-remove-keyframes.gif --frame-offset 4 -- -filter_complex 'fps=15'

datamosh shuffle-frames <source> <destination> [options]

Option | Default value | Description ----------------------|---------------|-------------------------------------------------------------------- --overwrite | - | Skips overwrite prompt and overwrites <destination> if it exists -p, --probability | 0.1 (=10%) | Probability of swapping a frame -r, --range | 2 | Range of neighbouring frames to swap

The shuffle-frames command shuffles B/P-frames around. Each B/P-frame has a probability of probability of being swapped. A greater probability will cause more distortion. If frame n is being swapped, it will swap with one of the neighbouring frames, based on range. A greater range will cause more stuttering, depending on probability.

Example

datamosh shuffle-frames examples/stickers.mp4 examples/stickers-shuffle-frames.gif --probability 0.25 --range 4 -- -filter_complex 'fps=15'

What are these stickers from?

Disclaimer

This project is not affiliated with the logos/brands shown in the examples. I’m just a sticker-owning fan. Don’t sue me. Send me a message if you’re angry.