Skip to main content

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.
Screenshot of a YouTube video with the mouse's cursor hovering over the progress bar at the bottom of the video player. The video is playing at minute 2:15, but the cursor is hovering over the minute 5:13. Over the cursor there's a thumbnail image showing the frame that will be played at minute 5:13.
© 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:
Grid of tiny 10x10 images showing the video's frames at a regular interval.
© 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

thumbframes_dl-0.13.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

thumbframes_dl-0.13.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file thumbframes_dl-0.13.0.tar.gz.

File metadata

  • Download URL: thumbframes_dl-0.13.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for thumbframes_dl-0.13.0.tar.gz
Algorithm Hash digest
SHA256 76687a5a06e149f6f58059f062ff4837e828f761e816eb333d42e1d7014b0095
MD5 7e655404c2ec40da0813989fa5affaf4
BLAKE2b-256 fa651045dcff8b779d2d5fa76b0ac6146b44770901e4b0b858f7343eb9479002

See more details on using hashes here.

File details

Details for the file thumbframes_dl-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thumbframes_dl-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b411824c0f2e9fa5ee70cae9678feab46f0af80a8d9e67a88de7cc72ec6831
MD5 1c0cf19724b654bf9884021d7c1fe6b3
BLAKE2b-256 9a5f47fcd6b7724d3738c0f0d5348691440ebce6499e145388439c9bcd3c0ce2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page