Generate thumbnail sprites from videos.
Almost all video players enhances user's seekbar navigation by providing a thumbnail preview of the moments where the user want to seek, so generate this sprites shouldn't be hard. This is a python script that, given a video, generates a thumbnail sprite image from it.
- Clone it:
$ git clone git@github.com:flavioribeiro/video-thumbnail-generator.git
- Then go to the project's folder:
$ cd video-thumbnail-generator
- And finally run:
$ chmod a+x build && ./build
$ ./generator --help
Video Thumbnail Generator
Usage:
./generator <video> <interval> <width> <height> <columns> <output> [<parallelism>]
./generator (-h | --help)
./generator --version
Options:
-h --help Show this screen.
--version Show version.
<video> Video filepath.
<interval> Interval em seconds between frames.
<width> Width of each thumbnail.
<height> Height of each thumbnail.
<columns> Total number of thumbnails per line.
<output> Output.
[<parallelism>] Number of files to process in parallel
Single file
$ ./generator samples/sample.mp4 60 300 200 2 output/sample.mp4.png
[sample.mp4] Extracting frame 1/3
[sample.mp4] Extracting frame 2/3
[sample.mp4] Extracting frame 3/3
[sample.mp4.png] Savedacted.
Saved!
Directory
$ ./generator samples/ 60 300 200 2 output/
[sample copy.mp4] Extracting frame 1/3
[sample.mp4] Extracting frame 1/3
[sample copy.mp4] Extracting frame 2/3
[sample.mp4] Extracting frame 2/3
[sample copy.mp4] Extracting frame 3/3
[sample.mp4] Extracting frame 3/3
[sample copy.mp4.png] Saved
[sample.mp4.png] Saved
- Fork it!
- Create your feature branch:
git checkout -b my-awesome-new-feature
- Commit your changes:
git commit -m 'Add some awesome feature'
- Push to the branch:
git push origin my-awesome-new-feature
- Submit a pull request :]
This code is under Apache License.