Skip to content

A movie barcode generator with multithreading and logging support. Built in C++ using OpenCV.

License

Notifications You must be signed in to change notification settings

JayGupta797/barcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Barcode

Self-described engineer, space lover and tea drinker Thomas Poulet defines a movie barcode as follows:

A Movie Barcode is the color identity card of the movie. Basically for each frame you take the dominant color and create a stripe out of it. The result is an overview of the overall mood of the movie.

It is worth noting that this program computes the row-wise average over a batch of frames rather than the dominant or modal color. In practice, this yields a reasonable effect.

Approach

Conceptually, my approach uses two key ingredients: a Reader and Process function in alignment with the Producer/Consumer design pattern. The reader is responsible for reading in frames and the workers process a batch of frames into a strip.

Options

Option Description Default
-f, --file <file> Movie file (required) -
-r, --rate <rate> Sampling rate 1
-b, --batches <batches> Number of batches 100
-w, --workers <workers> Number of workers 5
-v, --verbose Verbose output false
-t, --transform Transform output false
-h, --help Display this help message -

To generate a barcode with the default settings:

./barcode -f example.mp4

To generate a barcode with a sampling rate of 2, 50 batches, and 10 workers:

./barcode -f example.mp4 -r 2 -b 50 -w 10

To enable verbose output and apply a transform to the output:

./barcode -f example.mp4 -v -t

Feel free to customize further based on your project's requirements and additional information you may want to include.

Example

Here is an example using a compilation of cutscenes from Zelda Breath of the Wild. In post, a filter was applied to brighten colors and squoosh was used to compress the image to a reasonable size.

vTBflB3o

About

A movie barcode generator with multithreading and logging support. Built in C++ using OpenCV.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published