feat(video-node): Make video format tooltip dynamic based on ffmpeg availability

This change modifies `DiscordSendSaveVideo.INPUT_TYPES` to check for `ffmpeg_path` existence.
- If FFmpeg is missing: The default format is set to "video/gif" (the only available fallback), and the tooltip is updated to explicitly warn the user and explain that FFmpeg installation is required for other formats.
- If FFmpeg is present: The behavior remains unchanged with the full list of formats and detailed tooltip.

This improves UX by preventing confusion when users see MP4 options in the tooltip but can't select them, and provides a clear call to action.
This commit is contained in:
google-labs-jules[bot]
2026-01-18 01:26:25 +00:00
parent 5610f51a71
commit 291fa65a7b
+19 -15
View File
@@ -147,11 +147,13 @@ class DiscordSendSaveVideo:
"""
Define the input types for the DiscordSendSaveVideo node.
"""
# Check if ffmpeg is available
# Determine format options and defaults based on ffmpeg availability
if ffmpeg_path is None:
print("ffmpeg not found. Video output will be limited or unavailable.")
# Always make GIF available even without ffmpeg (we'll use PIL as fallback)
video_formats = ["video/gif"]
format_default = "video/gif"
format_tooltip = "⚠️ FFmpeg not found! Only GIF format is available (using PIL fallback).\n\nPlease install FFmpeg to unlock MP4, WebM, and other video formats."
else:
# Enhanced video formats for high-quality output
video_formats = [
@@ -170,6 +172,20 @@ class DiscordSendSaveVideo:
# Professional formats
"video/prores", # Apple ProRes (high quality, low compression)
]
format_default = "video/h264-mp4"
format_tooltip = ("The video format to save in. Options include:\n"
"# Image formats:\n"
"- image/gif: Standard GIF format (NO AUDIO support)\n"
"- image/webp: WebP format (better quality than GIF, NO AUDIO support)\n"
"- video/gif: Video format GIF (higher frame rate support, NO AUDIO support)\n\n"
"# Standard video formats:\n"
"- video/mp4: Standard MP4 format with good compatibility (supports audio)\n"
"- video/h264-mp4: High-quality MP4 with H264 codec (supports audio)\n"
"- video/h265-mp4: MP4 with H265/HEVC codec (better compression, supports audio)\n"
"- video/webm: Standard WebM format (supports audio)\n"
"- video/vp9-webm: WebM with VP9 codec (higher quality, supports audio)\n\n"
"# Professional formats:\n"
"- video/prores: Apple ProRes (professional quality, supports audio when saving locally but NO AUDIO when sending to Discord, requires QuickTime or specialized player to view on Windows)")
return {
"required": {
@@ -180,20 +196,8 @@ class DiscordSendSaveVideo:
"optional": {
# Video format settings
"format": (video_formats, {
'default': "video/h264-mp4",
"tooltip": "The video format to save in. Options include:\n" +
"# Image formats:\n" +
"- image/gif: Standard GIF format (NO AUDIO support)\n" +
"- image/webp: WebP format (better quality than GIF, NO AUDIO support)\n" +
"- video/gif: Video format GIF (higher frame rate support, NO AUDIO support)\n\n" +
"# Standard video formats:\n" +
"- video/mp4: Standard MP4 format with good compatibility (supports audio)\n" +
"- video/h264-mp4: High-quality MP4 with H264 codec (supports audio)\n" +
"- video/h265-mp4: MP4 with H265/HEVC codec (better compression, supports audio)\n" +
"- video/webm: Standard WebM format (supports audio)\n" +
"- video/vp9-webm: WebM with VP9 codec (higher quality, supports audio)\n\n" +
"# Professional formats:\n" +
"- video/prores: Apple ProRes (professional quality, supports audio when saving locally but NO AUDIO when sending to Discord, requires QuickTime or specialized player to view on Windows)"
'default': format_default,
"tooltip": format_tooltip
}),
"frame_rate": (
"FLOAT",