ComfyUI  >  Nodes  >  komojini-comfyui-nodes >  YouTube Video Loader

ComfyUI Node: YouTube Video Loader

Class Name

YouTubeVideoLoader

Category
komojini/Video
Author
komojini (Account age: 584 days)
Extension
komojini-comfyui-nodes
Latest Updated
5/22/2024
Github Stars
0.1K

How to Install komojini-comfyui-nodes

Install this extension via the ComfyUI Manager by searching for  komojini-comfyui-nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter komojini-comfyui-nodes in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Cloud for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

YouTube Video Loader Description

Facilitates YouTube video download, frame extraction, and properties adjustment for AI applications.

YouTube Video Loader:

The YouTubeVideoLoader node is designed to facilitate the downloading and processing of videos directly from YouTube. This node allows you to specify a YouTube URL and various parameters to control the video download and frame extraction process. It is particularly useful for AI artists who need to work with video data, as it simplifies the process of obtaining and preparing video frames for further analysis or creative projects. By leveraging this node, you can easily download videos, extract frames, and adjust video properties such as frame rate and resolution, making it a versatile tool for video-based AI applications.

YouTube Video Loader Input Parameters:

youtube_url

This parameter specifies the URL of the YouTube video you want to download. It is a required parameter and must be a valid YouTube URL. The default value is "youtube/url/here".

output_dir

This optional parameter allows you to specify the directory where the downloaded video will be saved. If not provided, the video will be saved in a default directory. The default value is an empty string.

start_sec

This parameter defines the starting point in seconds from which the video frames should be extracted. It is a required parameter with a default value of 0.0, and it can range from 0.0 to 10000.0 seconds.

end_sec

This parameter specifies the ending point in seconds up to which the video frames should be extracted. It is a required parameter with a default value of 0.0, and it can range from 0.0 to 10000.0 seconds.

max_fps

This parameter sets the maximum frames per second (FPS) for the extracted video frames. It is a required parameter with a default value of -1, which means no limit. The value can range from -1 to 30 FPS.

force_size

This parameter allows you to force the size of the extracted video frames to specific dimensions. The available options are "Disabled", "256x?", "?x256", "256x256", "512x?", "?x512", "512x512", "?x768", "768x?". The default value is "Disabled".

frame_load_cap

This parameter sets the maximum number of frames to be loaded from the video. It is a required parameter with a default value of 50, and it can range from 1 to 10000 frames.

YouTube Video Loader Output Parameters:

images

This output parameter contains the extracted video frames as a tensor. Each frame is represented as an image, and the tensor includes all the frames extracted based on the specified parameters.

frame_count

This parameter indicates the total number of frames extracted from the video. It provides a count of the frames that are available in the images output.

fps

This parameter represents the frames per second (FPS) of the extracted video frames. It indicates the rate at which the frames were captured from the video.

width

This parameter specifies the width of the extracted video frames. It provides the horizontal dimension of each frame in pixels.

height

This parameter specifies the height of the extracted video frames. It provides the vertical dimension of each frame in pixels.

YouTube Video Loader Usage Tips:

  • Ensure that the youtube_url is a valid and accessible YouTube link to avoid download errors.
  • Use the start_sec and end_sec parameters to extract specific segments of the video, which can save processing time and resources.
  • Adjust the max_fps parameter to control the frame rate of the extracted video frames, especially if you need to match a specific FPS for your project.
  • Utilize the force_size parameter to resize the extracted frames to a desired resolution, which can be useful for standardizing input sizes for AI models.

YouTube Video Loader Common Errors and Solutions:

"No frames generated"

  • Explanation: This error occurs when no frames are extracted from the video, possibly due to incorrect start_sec and end_sec values or an issue with the video file.
  • Solution: Verify the start_sec and end_sec values to ensure they are within the video's duration. Check the YouTube URL and ensure the video is accessible and not restricted.

"Invalid YouTube URL"

  • Explanation: This error indicates that the provided YouTube URL is not valid or cannot be accessed.
  • Solution: Double-check the YouTube URL for correctness and ensure it is publicly accessible. Avoid using URLs from private or restricted videos.

"Output directory not found"

  • Explanation: This error occurs when the specified output_dir does not exist or cannot be created.
  • Solution: Ensure the output_dir path is valid and that you have the necessary permissions to create directories and save files in the specified location.

YouTube Video Loader Related Nodes

Go back to the extension to check out more related nodes.
komojini-comfyui-nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.