-
Notifications
You must be signed in to change notification settings - Fork 48
API Reference
Akash Mahanty edited this page Nov 13, 2021
·
14 revisions
Only one parameter out of path
and url
must have an argument, passing both will raise ValueError
. And if none of them has an argument the instance will raise videohash.exceptions.DidNotSupplyPathOrUrl
.
-
creates a VideoHash object that can be used to calculate the video hash value for a video
-
Parameters:
- path - Absolute path of the video file.
- url - URL of the video file. Every URL that is supported by the yt-dlp package can be used.
- storage_path - If you want to provide a storage path for the files created/downloaded by the instance, pass the absolute path to that directory.
- download_worst - The default argument is
True
and the instance downloads the worst quality video possible to save bandwidth. If set to False, download the default quality of youtube-dl/yt-dlp downloader. These two downloaders default to the best quality video.
- Base Exception for the videohash package. All the other exceptions inherit from
VideoHashError
.
- The storage path passed by the user does not exist. Make sure that the absolute directory path passed ends with either '/' or '' depending on your system to avoid this exception.
- The frames output directory passed to the frame extractor does not exist.
- The output directory passed to downloader for storing the downloaded video does not exist.
- Must supply either a path for the video or a valid URL.
- Raised if zero frames are passed for collage making.
- Download software failed to download the video from the URL.
- Base error for the FFmpeg software.
- FFmpeg is either not installed or not in the executable path of the system.
- FFmpeg failed to extract any frame at all. Maybe the input video is damaged or corrupt.