An open API service indexing awesome lists of open source software.

https://github.com/qbixxx/datamosh

A Bash abomination that slaps two videos together using unsupervised datamoshing magic. Works (barely) on my machine
https://github.com/qbixxx/datamosh

avi bash bash-script datamosh datamosh-glitch datamosher datamoshing datamoshing-filter ffmpeg ffmpeg-script linux mp4 mp4-video vlc

Last synced: about 2 months ago
JSON representation

A Bash abomination that slaps two videos together using unsupervised datamoshing magic. Works (barely) on my machine

Awesome Lists containing this project

README

          

# 🔥 Datamosh - The Glitchy Video Toy™

![It Works On My Machine](https://img.shields.io/badge/It_Works-On_My_Machine-success?style=for-the-badge)
![Not for Production](https://img.shields.io/badge/Not_for-Production-red?style=for-the-badge)
![Glitch Level](https://img.shields.io/badge/Glitch_Level-Over_9000-blueviolet?style=for-the-badge)

A small command-line tool for creating **datamosh** effects between video files. Expect glitches, weird colors, pixel trails… and a lot of happy accidents.

---

## What is this?

This is a bash script that intentionally manipulates video data to create the well-known glitch aesthetic: colors blend in strange ways, shapes smear across frames, and compression artifacts turn into visuals of their own.

It’s not meant for professional use—think of it more like a digital art toy. Perfect for experimentation, music videos, or just messing around.

---

## Works On My Machine™ Guarantee

This was tested on my setup and it produced actual glitchy videos without catastrophic side effects. Your results may vary depending on OS, ffmpeg version, or cosmic alignment.

If it runs fine for you, great! 🎉
If not… well, glitches are part of the charm.

---

## Installation

You’ll need a couple of tools installed:

- `ffmpeg` (video processing)
- `bc` (basic math)

```bash
# Install dependencies
sudo apt install ffmpeg bc

# Clone this repository
git clone https://github.com/qbixxx/datamosh.git
cd datamosh

# Make the script executable
chmod +x datamosh.sh
```

---

## Usage

Basic usage:

```bash
./datamosh.sh input1.mp4 input2.mp4
```

This will generate an output file named something like:
`datamoshed_20250501_123045.mp4`

### More options

```bash
# Custom output filename (timestamp still added)
./datamosh.sh input1.mp4 input2.mp4 my_output.mp4

# Apply a glitch profile
./datamosh.sh --profile bloom input1.mp4 input2.mp4

# Set intensity level (1–5)
./datamosh.sh input1.mp4 input2.mp4 3

# Also create a GIF
./datamosh.sh --gif input1.mp4 input2.mp4

# Show help
./datamosh.sh --help
```

---

## Profiles

- **glitch** – Subtle static-like distortion
- **bloom** – Color bleeding effects
- **smear** – Trailing/motion smear
- **extreme** – Heavy destruction
- **rainbow** – Saturated and colorful chaos

---

## How it works (in short)

1. Convert videos to AVI (Xvid codec)
2. Extract parts of them as raw binary
3. Remove or shift bytes in key spots
4. Concatenate the broken data
5. Re-encode back to MP4

Not the most efficient process, but it does the job.

---

## Demo
https://github.com/user-attachments/assets/9058e940-7ae0-4e25-9e86-bc477d0b8115

---

## Troubleshooting

**Q: Output is just black?**
A: That’s still valid glitch art—minimalist edition.

**Q: The video crashes my player?**
A: Try VLC or MPV. Some players don’t enjoy corrupted streams.

**Q: Doesn’t look glitchy enough?**
A: Use `--profile extreme` or increase intensity.

---

## Disclaimer

This script breaks video files on purpose. Use at your own risk. No warranties.

If it accidentally generates your next music video masterpiece, even better.

---

## License

MIT-style, with extra shrugging. Do what you want, just don’t hold me liable.

---

## Contributions

Pull requests are welcome! Bug fixes, new profiles, or unexpected new bugs that look cool are all appreciated.

---

## Acknowledgments

- Codec developers everywhere (sorry for abusing your work 🙏)
- ffmpeg, for being endlessly hackable
- Everyone who sees glitches and says “that looks broken”… when in fact, it’s working perfectly

---

👉 If someone asks what you’re doing, just say:
**“I’m experimenting with video compression artifacts.”**