OpenKatana · Preview source:
OpenKatana_preview_source creates a short, playable preview of source video so you can review movement, timing, framing, and available audio before making editing decisions. The supplied preview implementation uses FFmpeg to extract a selected section and encode it as an MP4 with H.264 video and AAC audio when an audio stream is present. It limits the preview’s width without deliberately enlarging smaller footage and adjusts the height to preserve the picture’s proportions. When the source contains audio, it also creates a separate mono WAV version for audio review or compatible downstream tools. This makes the node useful for checking a small section of footage without rendering an entire sequence. Creating these files does not mean the node has watched, listened to, or assessed their contents; you still need a capable player or client to review them.
OpenKatana · Preview source Input Parameters:
project_id
A required STRING supplied to the shared OpenKatana tool argument-building mechanism. It provides project context when the tool request is assembled; the supplied code does not show how that context is validated or how it affects source selection and preview storage. Use the identifier associated with the OpenKatana project you intend to work with rather than assuming this field accepts a video filename. The authoritative interface does not specify a default, allowed values, length limits, or a particular identifier format.
arguments
A required STRING containing the tool arguments that the shared OpenKatana argument-building mechanism interprets before calling the preview tool. This is the interface’s argument payload rather than a set of separate preview controls. The supplied preview implementation works with a source, an output directory, a start position, a duration, and a maximum width, but the provided material does not show the complete public tool schema or establish which of these values you must supply directly in this string. At the implementation level, start is measured in seconds and must be at least 0, duration must be between 0.05 and 15 seconds, and maximum width must be an integer between 160 and 1920 pixels. These are preview-operation constraints, not additional node inputs. No default payload, default preview settings, or complete list of accepted argument keys is shown; follow the installed tool’s argument schema rather than assuming an empty string or an arbitrary JSON structure is valid.
after
An optional STRING accepted by the node’s execution method, with a Python default of None when omitted. In the supplied method, this value is not read, merged into the preview arguments, or explicitly forwarded to the tool invocation, so there is no demonstrated effect on preview timing, encoding, or file contents. A connection to this input may establish a workflow connection, but the provided code does not document any additional dependency-token behavior. No allowed string values, length limits, or interface widget default are shown.
OpenKatana · Preview source Output Parameters:
result_json
A STRING containing the response produced by the shared response formatter after the preview tool is called. Treat this as a tool response to inspect or parse, not as a ComfyUI image batch, video tensor, or audio tensor. The supplied preview implementation returns information including the MP4 path under video, a list of separate WAV paths under preview_audio, the requested start and duration, and a review note; the shared response formatter may package these details, and its exact outer structure is not provided. When source audio is detected, the implementation creates a mono, 16 kHz preview.wav and includes its path in the audio list; otherwise that list is empty. The MP4 is named preview.mp4 within the selected output directory. Returned paths identify files created in the execution environment and are not necessarily downloadable URLs or paths accessible from your local computer. The reported duration is the requested value, not an independently measured guarantee of the finished clip’s length, particularly when the selected range reaches beyond the source’s end.
OpenKatana · Preview source Usage Tips:
- Check the installed preview tool’s argument schema before filling in
arguments. The supplied interface exposes a general string payload, not separate widgets for source selection, timing, or preview resolution. - For a quick motion check, request a short section around the action you want to inspect. The preview implementation accepts durations from 0.05 to 15 seconds; a few seconds is generally more useful for judging movement than the minimum-length excerpt.
- Choose a nonnegative start position that falls inside the source video, and keep the requested section within the available footage when you need a complete preview. Selecting a range near the end can produce a shorter result.
- Where the tool schema exposes the maximum-width setting, use a smaller value such as 480 or 640 pixels for lightweight timing checks, and a larger value such as 1280 or 1920 pixels when framing details matter. The implementation does not intentionally upscale footage narrower than the chosen limit.
- Open the generated MP4 in a compatible player to review motion and synchronized audio. Use the separate WAV when you need audio-only playback or a compatible downstream audio tool; client support for audio blocks varies.
- Inspect the response structure before extracting file paths for another node. Do not assume that the implementation’s result fields appear at the top level of
result_json, because the shared response wrapper is not shown. - Ensure FFmpeg and its H.264 and AAC encoding support are available in the environment running OpenKatana. Preview generation occurs there, which may be a different machine or container from the one running your browser.
OpenKatana · Preview source Common Errors and Solutions:
Invalid or unsupported arguments payload
- Explanation: The argument string is processed by shared helpers whose parsing rules and exact error messages are not included in the supplied code. A malformed payload, missing required tool arguments, or unsupported keys can prevent the preview call from running.
- Solution: Check the installed tool’s documented argument schema and supply the expected format and keys. If it expects JSON, validate the JSON syntax before running the node. Do not assume the internal preview function’s parameter names are a complete public API example.
Preview values outside the supported range
- Explanation: The preview implementation validates start, duration, and maximum width before creating the preview. Start must be at least 0 seconds, duration must be between 0.05 and 15 seconds, and maximum width must be an integer between 160 and 1920 pixels. The exact validation error wording is not shown.
- Solution: Correct the relevant values in the tool argument payload using the installed schema. Use seconds for timing and a whole-number pixel value for maximum width.
No such file or directory
- Explanation: This is a possible filesystem or FFmpeg diagnostic rather than a guaranteed node-specific message. It can mean that the source cannot be found from the execution environment, or that an external executable required for processing is unavailable.
- Solution: Confirm that the source exists and is accessible from the machine or container running OpenKatana. If the error names FFmpeg or another executable instead of the source, install or configure that dependency in the same environment.
Permission denied
- Explanation: This is a possible operating-system diagnostic when the preview process cannot read the source or create files in the destination. The implementation must create an output directory and write the MP4 and, when applicable, WAV files.
- Solution: Make sure the OpenKatana process has read access to the source and write access to its output location. For container-based setups, check both mounted folders and their permissions.
FileExistsError / File exists
- Explanation: The implementation creates the output directory with
exist_ok=False, so it fails if that directory already exists. This prevents silently reusing an existing preview directory. - Solution: If the public tool allows you to choose an output location, select a new, unused directory. Otherwise, inspect how OpenKatana allocates preview directories and resolve the collision without deleting files you still need.
Stream map '0:v:0' matches no streams
- Explanation: FFmpeg requires the first video stream for this preview operation. An audio-only file or a file without a readable video stream cannot satisfy that requirement. Audio mapping is optional, so a silent video is not itself an error.
- Solution: Choose a source containing a valid video stream. If you intended to inspect an audio-only asset, use an audio-capable tool instead of this video-preview operation.
Unknown encoder 'libx264'
- Explanation: This is a possible FFmpeg diagnostic if the installed FFmpeg build does not include the H.264 encoder explicitly requested by the preview implementation.
- Solution: Install an FFmpeg build with
libx264support and verify that OpenKatana uses that executable. The supplied interface does not expose an encoder override.
Unknown encoder 'aac'
- Explanation: This is a possible FFmpeg diagnostic if the available FFmpeg build cannot provide the AAC audio encoder requested for the MP4 preview.
- Solution: Use an FFmpeg build with AAC encoding support. Check the executable available inside the actual OpenKatana runtime rather than only the version installed on your desktop.
Invalid data found when processing input
- Explanation: This is a possible FFmpeg diagnostic for an unreadable, damaged, unsupported, or incorrectly identified source file. Source metadata is checked before preview encoding, so processing may stop before any preview is created.
- Solution: Try opening the source in a media player, confirm that it is a genuine video file rather than a renamed file or incomplete download, and re-export or replace it if necessary.
Empty or shorter-than-expected preview
- Explanation: This is a possible result rather than a documented exception string. The selected start may be at or beyond the end of the video, or the requested duration may extend past the available footage. The returned duration field records the request rather than measuring the resulting file.
- Solution: Check the source’s actual length, move the start earlier, and choose a duration that fits inside the remaining footage. Play the resulting MP4 to confirm the usable length.
unexpected inputs: …
- Explanation: This exact error prefix is raised by the node wrapper when extra keyword inputs are supplied that are not recognized by its typed input definitions. It is most relevant to programmatic calls or modified workflows.
- Solution: Use only the exposed inputs
project_id,arguments, and optionalafter. Put supported preview options inside the argument payload according to the tool schema rather than adding new node inputs.
