flavioribeiro / video-thumbnail-generator Goto Github PK
View Code? Open in Web Editor NEW:camera: Generate thumbnail sprites from videos.
License: Apache License 2.0
:camera: Generate thumbnail sprites from videos.
License: Apache License 2.0
Great tool! Could the temp directory be configurable?
Or maybe generated automatically using on of these: https://docs.python.org/2/library/tempfile.html
SpooledTemporaryFile()
sounds like it could be quite good for performance if it just holds the temp files in memory.
$pip2 install docopt
Requirement already satisfied: docopt in /usr/local/lib/python2.7/site-packages
$ ./generator
Traceback (most recent call last):
File "./generator", line 21, in
from docopt import docopt
ImportError: No module named docopt
Hi, I have a php script that parses the sprite image I create with your awesome script... it is focused to generate image coordinates based on a single row of sprite images.
Is it possible for force your script to do that without knowing or calculating the number of total frames from the source video file?
Thanks
refs #3
In build
it makes a symlink of /usr/local/include/freetype2
, but I don't have this file.
Also, since it creates symlinks, it'd be nice to provide a way to remove them.
Running Python 3.8.10
Installation went ok, trying to generate thumbnails with ./generator BigBuckBunny.mp4 30 320 180 4 ../video/sprites/test.png
I get
[BigBuckBunny.mp4] Extracting frame 1/19
[BigBuckBunny.mp4] Error occurred with file
There's some players that uses WebVTT to display the thumbnails.
generator output always ends like this:
[sample.mp4] Extracting frame 100/101
[sample.jpg] Saved
The actual generated frame count is correct. Easily fixed by correcting the print loop.
Running ./generator will immediately download an ffmpeg binary from a 3rd party repo. This is not really a secure solution and should require at least for the user to agree to the download. Preferably they should be able to provide a path to their own ffmpeg binary.
Currently there is a hidden hardcoded limit of 100000 (from 00000 to 99999) up to which sorting of the generated temporary png files works via zero padding:
https://github.com/flavioribeiro/video-thumbnail-generator/blob/master/generator#L142
The script should handle the cases where this breaks. 2 alternatives come to mind:
With the second alternative one could limit the amount of allowed frames in a transparent and configurable fashion via a max option. Which arguably would make sense anyway, because loading a huge sprite could interfere with video playback over slow connections.
Currently the CLI will error out if the file already exists, would be great if we could pass a flag to overwrite. Useful for development purposes.
Cloning into 'video-thumbnail-generator'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I follow the instructions:
chmod a+x build && ./build
it show me the following error:
DEPRECATION: --allow-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
Collecting docopt==0.6.1 (from -r requirements.txt (line 1))
Using cached docopt-0.6.1.tar.gz
Collecting moviepy (from -r requirements.txt (line 2))
Using cached moviepy-0.2.3.2-py2.py3-none-any.whl
Collecting PIL (from -r requirements.txt (line 5))
Could not find a version that satisfies the requirement PIL (from -r requirements.txt (line 5)) (from versions: )
I am using python 2.7 on Mac
The result sprite is saved in RGBA mode.
Fail over to RGB if alpha is not supported by target format, e.g. jpeg.
I needed to add click to requirements.txt
With recent changes shutil now tries (and fails silently) to remove a tree with path generated here: https://github.com/flavioribeiro/video-thumbnail-generator/blob/master/generator#L195 which is actually the so-called 'prefix' of the temporary png filenames.
shutil instead should try to remove TMP_FRAMES_PATH
presumably.
However I am not sure how this fares with the new directory processing feature.
I also don't know in which scenario the TMP_FRAMES_PATH is recreated: https://github.com/flavioribeiro/video-thumbnail-generator/blob/master/generator#L193-L194 (instead of creating a new temporary directory safely).
I'm quite new to pip3 scripting... so I don't know it is possible to generate a thumbnail sprite from a remote URL or stored on a bucket (e.g. AWS / Firebase Storage).
Can it create thumbnail sprites from all of these files: MP4, MOV, MKV
Thanks for the superb script
#STAYSAFE
HI. I am getting a syntaxerror when running the script:
[desarrollo-01@centos-d01 video-thumbnail-generator]$ ./generator --help File "./generator", line 42 print "Extracting", int(videoFileClip.duration / interval), "frames" ^ SyntaxError: invalid syntax
I am using python 3.6 on centos 8. pip dependence's install looks normal.
Thanks you!
Because 6640769#diff-dac9630aec642a428cd73f4be0a03569R27 creates a temporary file not a directory, shutil.rmtree
only removes an empty file.
tempfile.mkdtemp
should be used to create a temporary directory.
Maybe related to #7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.