Skip to content

A Python Command-Line Tool That Downloads A YouTube Video At The Highest Progressive Resolution (Up To 1080p) And Extracts All Its Frames As Individual Image Files.

Notifications You must be signed in to change notification settings

kode0x/FrameSnag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

FrameSnag

YouTube Video Downloader & Frame Extractor

A Python Command-Line Tool That Downloads A YouTube Video At The Highest Progressive Resolution (Up To 1080p) And Extracts All Its Frames As Individual Image Files.


Features

  • Downloads A YouTube Video In MP4 Format (Up To 1080p Resolution).
  • Extracts Every Frame From The Downloaded Video As JPEG Images.
  • Shows Real-Time Progress For Both Downloading And Frame Extraction.
  • Handles Errors Gracefully.
  • Customizable Output Video Filename And Frames Folder.

Requirements

  • Python 3.7 or Higher
  • yt-dlp Python Package
  • opencv-python Package

Install Required Packages With:

pip install yt-dlp opencv-python

Usage

python FrameSnag.py <YouTube_URL> [-o OUTPUT_VIDEO] [-f FRAMES_FOLDER]

Arguments

  • <YouTube_URL>: The URL of The YouTube Video To Download.

Optional Arguments

  • -o, --output: Output Filename For The Downloaded Video (Default: downloadedVideo.mp4).
  • -f, --framesFolder: Folder To Save Extracted Frames (Default: Frames).

Example

Download A Video And Extract Frames:

python FrameSnag.py https://www.youtube.com/watch?v=dQw4w9WgXcQ

Specify Output Video Name And Frames Folder:

python FrameSnag.py https://www.youtube.com/watch?v=dQw4w9WgXcQ -o myvideo.mp4 -f MyFrames

How It Works

  1. Download Video: The Script Downloads The YouTube Video At The Best Available Progressive MP4 Format Up To 1080p Using yt-dlp.

  2. Extract Frames: Using OpenCV, It Reads The Downloaded Video Frame By Frame And Saves Each Frame As A JPEG Image In The Specified Folder.


Notes

  • Make Sure The YouTube URL Is Valid And Accessible.
  • The Script Currently Does Not Download Playlists (It Will Download Only The Video At The Given URL).
  • Frame Extraction May Take Time Depending On The Length And Resolution of The Video.

License

MIT License

About

A Python Command-Line Tool That Downloads A YouTube Video At The Highest Progressive Resolution (Up To 1080p) And Extracts All Its Frames As Individual Image Files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages