πͺ Frame Number Overlay:
The FrameNumberOverlay node is designed to enhance video frames by overlaying frame numbers directly onto each image in a batch. This utility is particularly useful for video editing and analysis, where keeping track of frame sequences is crucial. By embedding frame numbers as text overlays, you can easily identify and reference specific frames within a video sequence. This node offers flexibility in terms of customization, allowing you to adjust the font size, position, color, and even add prefixes or suffixes to the frame numbers. The primary goal of this node is to provide a clear and efficient way to annotate frames, making it easier to manage and analyze video content.
πͺ Frame Number Overlay Input Parameters:
images
This parameter expects a batch of images, typically representing frames from a video. The node will process each image individually to apply the frame number overlay.
font_size
This integer parameter determines the size of the font used for the frame number overlay. It can range from a minimum of 8 to a maximum of 256, with a default value of 32. Adjusting the font size allows you to ensure that the frame numbers are clearly visible without overwhelming the image content.
start_index
This integer parameter specifies the starting index for the frame numbers. It ranges from 0 to 99999, with a default value of 0. This allows you to control the numbering sequence, which is particularly useful if you are working with a subset of frames from a larger video.
position
This parameter defines the position of the frame number overlay on the image. You can choose from four options: "top-left", "top-right", "bottom-left", and "bottom-right". This flexibility allows you to place the overlay in a location that does not obscure important parts of the image.
padding
This integer parameter sets the padding between the frame number text and the edges of the image. It ranges from 0 to 256, with a default value of 10. Padding helps to ensure that the text is not too close to the image borders, improving readability.
font_color
This string parameter specifies the color of the font used for the frame number overlay. The default color is "white", but you can choose any color that contrasts well with the image background to ensure visibility.
prefix
This string parameter allows you to add a prefix to the frame number. By default, it is an empty string. Adding a prefix can be useful for labeling or categorizing frames.
suffix
This string parameter allows you to add a suffix to the frame number. Like the prefix, it defaults to an empty string. A suffix can be used to append additional information to the frame number.
πͺ Frame Number Overlay Output Parameters:
images
The output is a batch of images with the frame number overlay applied. Each image in the batch will have its corresponding frame number embedded as a text overlay, allowing for easy identification and reference.
πͺ Frame Number Overlay Usage Tips:
- To ensure the frame numbers are visible, choose a font color that contrasts well with the predominant colors in your images.
- Use the padding parameter to adjust the distance of the text from the image edges, which can help prevent the overlay from obscuring important image details.
- If working with a specific segment of a video, adjust the start_index to match the actual frame numbers in your sequence for accurate labeling.
πͺ Frame Number Overlay Common Errors and Solutions:
Cannot decode frame <frame_index>: codec '<codec_name>' is not supported.
- Explanation: This error occurs when the node attempts to process a video frame encoded with an unsupported codec.
- Solution: Re-encode the video using a supported codec such as h264, h265, or vp9 before processing it with the node.
ValueError: Invalid font size.
- Explanation: This error is raised if the font_size parameter is set outside the allowed range.
- Solution: Ensure that the font_size is set between 8 and 256.
IndexError: Frame index out of range.
- Explanation: This error occurs when the start_index is set beyond the available frames in the batch.
- Solution: Verify that the start_index is within the range of the total number of frames in the batch.
