Download thumbnail frames from a video's progress bar
Project description
thumbframes_dl
Download thumbnail frames from a video's progress bar.
When you watch a video on the web, you've probably noticed these thumbnail sized preview frames that are shown when you hover the cursor over the video player's progress bar.
© Blender Foundation | cloud.blender.org/spring
When you download the actual images, you'll see that they're actually concatenated in grids containing n*m frames like this:
© Blender Foundation | cloud.blender.org/spring
I refer to this individual frames as thumbframes because I couldn't find a better, less confusing name.
How to use
Install the library:
pip install thumbframes-dl
A simple example:
# Download a video's thumbframes images and save them in the filesystem
# Spring | Blender Animation Studio | CC BY 4.0
from thumbframes_dl import YouTubeFrames
# create YouTubeFrames object containing the methods to get the thumbframes
video = YouTubeFrames('https://www.youtube.com/watch?v=WhWc3b3KhnY')
# iterate all images with thumbframes (there may be more than one)
for i, frames_image in enumerate(video.get_thumbframes()):
file_content = frames_image.get_image()
with open(f"{video.video_id}_{i}.{frames_image.mime_type}", "wb") as f:
f.write(file_content) # save each image
For a couple more examples showing the potential usefulness of thumbframes see the demos.
For a more detailed description of the API see the API documentation.
Copyright
All the code in thumbframes_dl is released into the public domain by its authors. See LICENSE.
All the text in thumbframes_dl's documentation is likewise released into the public domain under the same license.
The images used in the documentation are attributed to their copyright owners and shared under their respective Creative Commons licenses.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file thumbframes_dl-0.11.0.tar.gz
.
File metadata
- Download URL: thumbframes_dl-0.11.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d15ad7d0b856a85b13f8ddcc0afb82bfdf93730173ed5e1b1a62670f531b45e1 |
|
MD5 | 27e0e1373c7df097da7d8a3bd04bf550 |
|
BLAKE2b-256 | 8dcd89b85355332bb408ad7056a2d4f14c633a8b4510f04433cd7221bd12d74a |
File details
Details for the file thumbframes_dl-0.11.0-py3-none-any.whl
.
File metadata
- Download URL: thumbframes_dl-0.11.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16d29da1bc2c287f52ede0e97fec7932570a2e52475de827a9d3fc53727a3beb |
|
MD5 | 64b4cc60b896c32f0a92370e4c5b0577 |
|
BLAKE2b-256 | 6ffc98100733e8f123813d305598f7417d801651f57b01cfd5ab6be31fe9e369 |