A command line tool to generate the color spectrum for a given input video file.
Source video | Result Spectrum |
---|---|
Build:
go build -o moviespectrum-cli cmd/moviespectrum/cli.go
Prepare a video file, e.g. download it from youtube:
youtube-dl --format 160 https://www.youtube.com/watch?v=3-HiGBJ7nJ0
Run the tool:
./moviespectrum-cli 'KikoRiki Ep. 6 - Season 3 - The Border-3-HiGBJ7nJ0.mp4'
The resulting spectrum image file is saved to the file with the same file name as the source video with additional ".png" extension.
Build:
go build -o moviespectrum-rest-service cmd/moviespectrum/rest_service.go
Run the service:
./moviespectrum-rest-service
Then, open http://localhost:8080 in a browser
https://moviespectrum.azurewebsites.net/
- Convert the source video to 256x144 RGB frames
- Convert each pixel to HSL
- Spectrum X axis is pixel's Hue
- Color weight = Saturation * Median lightness difference
- Median lightness difference = chi square difference for the pixel's lightness and lightness range middle