Giter Club home page Giter Club logo

video-crusher's Introduction

video-crusher

Very lossy video compression.

Description

video-crusher is used to make videos worse for artistic or technical reasons.
Videos get deconstructed into frames at a specified sample frame rate.
These frames are saved in a frame directory and can then be modified in their resolution, color depth, etc.
video-crusher is able to recombine them into a new video if desired.
It is also possible to reduce the audio bandwidth or audio bit depth.

Command Line Arguments

$ video-crusher INPUTFILE OUTPUTFILE

The video files to work on.
OUTPUTFILE will also be used as the name for the frame directory.

$ video-crusher --verbose

Print full debug information.

$ video-crusher -colors INT

Reduces the number of color levels per channel to a specified amount.
Acceptable values: 2 - 256

$ video-crusher -fps INT

The frame rate to sample the input video at.
Defaults to the input frame rate.

$ video-crusher -cspace SELECTION

Convert video to this color space. (RGB = 24-bit color, L = 8-bit grayscale, 1 = 1-bit grayscale)
Defaults to RGB.

$ video-crusher -crushwidth INT -crushheight INT

Resolution video will be downsampled to.

$ video-crusher -crushfactor INT

Alternative way of setting -crushwidth and -crushheight.
Reduces input video resolution by a set factor.

$ video-crusher --upsample

Returns frames to a higher resolution after downsampling.
This preserves sharp pixel edges during video compression.

$ video-crusher -upsamplewidth INT -upsampleheight INT

Resolution to upsample frames to.
Defaults to the input video resolution.

$ video-crusher --rmframeimg

Remove the frame directory after video recombination.

$ video-crusher --novideo

Don't recombine frames into a video.

$ video-crusher --noaudio

Don't add audio back into the output video.
Please set this flag if the input video contains no audio.

$ video-crusher --overwrite

Overwrite files that already exist at the specified output location.

$ video-crusher -lowpass INT

Low-pass audio at a specified frequency.

$ video-crusher -highpass INT

High-pass audio at a specified frequency.

$ video-crusher -audiobits INT

Reduce the audio bit resolution to the specified level.

$ video-crusher -falsecolor PALETTE_FILE

Supply a false color palette to be applied to the video.

False color palettes

A false color palette is a text file consisting of 256 newline separated 24-bit color values.
Example palettes are supplied in the "palettes/" directory.
Palettes are encoded as ASCII.
When applying a palette, the image is first converted to grayscale, and the grayscale value is then used to look up an RGB color in the palette.
All example palettes use the .vcpal filename extension.

Example outputs

Input video used for examples: Noisestorm - Crab Rave (Official Music Video)

$ video-crusher in.mp4 out.mp4 -fps 10 -crushfactor 10 -cspace L -colors 4 --upsample -lowpass 500  

Output video

$ video-crusher in.mp4 out.mp4 -fps 10 -crushfactor 4 -falsecolor palettes/nipy_spectral.vcpal --upsample -audiobits 1  

Output video

$ video-crusher in.mp4 out.mp4 -fps 10 -crushfactor 17 -cspace L -colors 2 --upsample  

Output video

$ video-crusher in.mp4 out.mp4 -fps 10 -crushfactor 17 -cspace 1 --upsample  --noaudio

Output video

Considerations

Decompressing high resolution or long videos to bitmaps takes a lot of drive space.

Color Resolution Frame rate Size
24-bit RGB 1920x1080 30 fps 10.4 GiB/min
24-bit RGB 1920x1080 10 fps 3.5 GiB/min
24-bit RGB 720x480 30 fps 1.7 GiB/min
24-bit RGB 720x480 10 fps 580 MiB/min

Acknowledgments

The example palettes were made from matplotlib color maps.

Dependencies

Other

Published under GPL-3.0 license.

video-crusher's People

Contributors

ndornseif avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.