Forked from https://github.com/andrewdcampbell/movie-barcodes
Python program to generate a movie "barcode", or a visualization of the colour palette used in a film. It is generated by compressing each frame into a single column of pixels that are stacked sequentially to form a barcode-like image. Makes for a neat wallpaper.
There are many implementations available, and I don't claim this is the best, but it's clean, simple, efficient, and easily-customizable. Automatically adjusts sample rate according to the length of the video. Runs in under 2 minutes for a typical 2 hour movie.
Supported on Python 3 and OpenCV 3+.
python3 -m venv .venv
source .venv/bin/activatepip install git+https://github.com/michimussato/movie-barcodesThe Lord of the Rings: The Fellowship of the Ring

$ movie-barcode --help
usage: movie-barcode [-h] [-v] [-vv] --video VIDEO [--uniform] [--out-dir OUT_DIR] [--width WIDTH] [--height HEIGHT] [--sample-height SAMPLE_HEIGHT]
options:
-h, --help show this help message and exit
-v, --verbose set loglevel to INFO
-vv, --very-verbose set loglevel to DEBUG
--video VIDEO Video file.
--uniform Use uniform color columns.
--out-dir OUT_DIR Where to save the output file.
--width WIDTH Width of the barcoded image.
--height HEIGHT Height of the barcoded image.
--sample-height SAMPLE_HEIGHT
Sample Height of the barcoded image. In compressed mode, each frame is resized into a 1xSAMPLE_HEIGHT vector. SAMPLE_HEIGHT should be at most the input
height and at least 1 (which is equivalent to uniform mode). Smaller values yield smoother results.
Example:
movie-barcode --video "<full_path_to_movie>.mp4" --out-dir "<full_path_to_output_dir>/" --width 3000 --height 1 --sample-height 1





