Video Frame Player (C2C):
The VideoFramePlayerMEC node is designed to facilitate the playback and manipulation of video frames within a batch processing environment. It allows you to efficiently handle video data by trimming, indexing, and previewing frames, making it an essential tool for video editing and analysis tasks. This node is particularly beneficial for AI artists who need to work with video sequences, as it provides a streamlined method to access and manipulate frames without losing quality. By supporting various formats for preview thumbnails and caching them on disk, it ensures that you can quickly visualize and iterate on your video content. The node's ability to handle different frame ranges and strides makes it versatile for various applications, from simple playback to complex video processing workflows.
Video Frame Player (C2C) Input Parameters:
frames
The frames parameter expects a 4D tensor representing a batch of video frames with dimensions (B, H, W, C), where B is the batch size, H is the height, W is the width, and C is the number of channels. This input is crucial as it forms the basis of all operations within the node. The frames must be in a valid format, as the node will raise an error if the input is missing or incorrectly shaped. This parameter allows you to specify the video data that you want to process, and its correct configuration is essential for the node's successful execution.
frame_start
The frame_start parameter defines the starting index of the frames you wish to process. It determines where the trimming of the video frames begins. The value should be within the range of available frames, and it defaults to the first frame if not specified. This parameter is important for focusing on a specific segment of the video, allowing you to skip unnecessary frames at the beginning.
frame_end
The frame_end parameter specifies the ending index of the frames to be processed. If set to a negative value, it indicates the last frame of the batch. This parameter, in conjunction with frame_start, allows you to define a precise range of frames for processing, which is useful for isolating specific parts of a video sequence.
frame_stride
The frame_stride parameter determines the step size between frames in the specified range. A stride of 1 means every frame is processed, while a higher stride value skips frames, which can be useful for creating time-lapse effects or reducing processing load. The minimum value is 1, ensuring at least one frame is processed.
frame_index
The frame_index parameter is used to select a specific frame within the trimmed range for preview purposes. It allows you to focus on a particular frame, which can be helpful for detailed analysis or when generating thumbnails. The index should be within the trimmed range to avoid errors.
preview_format
The preview_format parameter specifies the format of the preview thumbnails, with options being "png" for lossless quality or "jpeg" for faster processing. This choice affects the quality and speed of thumbnail generation, allowing you to balance between visual fidelity and performance.
preview_width
The preview_width parameter sets the width of the preview thumbnails. It controls the size of the generated previews, which can impact both the visual clarity and the storage requirements of the thumbnails. Adjusting this parameter allows you to tailor the previews to your specific needs.
preview_quality
The preview_quality parameter is relevant when the preview_format is set to "jpeg". It determines the quality of the JPEG compression, with higher values resulting in better quality but larger file sizes. This parameter helps you manage the trade-off between image quality and storage efficiency.
Video Frame Player (C2C) Output Parameters:
frames_trimmed
The frames_trimmed output provides the batch of frames that have been processed according to the specified start, end, and stride parameters. This output is essential for further video processing tasks, as it contains only the frames of interest, allowing for efficient downstream operations.
video_info_json
The video_info_json output is a JSON-formatted string containing metadata about the processed video frames, such as dimensions, frame count, and playback settings. This information is valuable for understanding the context of the processed video and for debugging purposes, as it provides a comprehensive overview of the node's operations.
Video Frame Player (C2C) Usage Tips:
- Ensure that the
framesinput is correctly formatted as a 4D tensor to avoid errors and ensure smooth processing. - Use the
frame_strideparameter to efficiently manage processing load by skipping unnecessary frames, especially in long video sequences. - Adjust the
preview_formatandpreview_qualitysettings based on your needs for speed versus image quality, particularly when generating thumbnails for quick previews.
Video Frame Player (C2C) Common Errors and Solutions:
" Video Frame Player (C2C): 'frames' input is missing or invalid (expected IMAGE B,H,W,C)."
- Explanation: This error occurs when the
framesinput is either not provided or not in the expected 4D tensor format. - Solution: Ensure that the
framesinput is a valid 4D tensor with dimensions (B, H, W, C) and that it is correctly passed to the node.
" Video Frame Player (C2C): expected 4D IMAGE (B,H,W,C), got shape (x, y, z, ...)."
- Explanation: The input
framesdoes not have the correct number of dimensions or is not structured as expected. - Solution: Verify that the
framesinput is a 4D tensor and that its dimensions match the expected format (B, H, W, C). Adjust the input data accordingly.
