Codec From Video Stream
Reading the label off the box
- codec
Before you can decode a video stream, you have to know what codec it's using - H.264, VP9, AV1, whatever. That's the job of Codec From Video Stream: probe the stream and report its codec so the rest of the pipeline knows how to handle it. It's the node that reads the label on the box.
This one comes from ComfyUI Core Video Nodes (Immac/ComfyUI-CoreVideoMocks), the pack that GitHub describes as "A set of mock nodes for RFC purposes" - and it's a beautiful example of the pack's whole trick. Real probing is genuinely hard. The stream's codec lives in container metadata, and parsing that metadata reliably is a library's worth of work (that's why real tools use PyAV or ffmpeg under the hood). The mock sidesteps all of it: no matter what you feed in, you get back the string "Mock Codec: VP9 and Options". It's hardcoded, it's always the same, and it's exactly the wrong answer if your stream is actually H.264.
The input and output
One input, video_stream (a STRING, force-input only - wire it from Split Video or a Get*Stream node). One output, codec, also a STRING. In a real workflow that codec string would flow into a decoder so it could pick the right demuxing strategy. Here it's a fixed placeholder.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Immac/ComfyUI-CoreVideoMocks
Restart ComfyUI. No pip dependencies, no models, no ffmpeg - the pack is pure Python on ComfyUI's own folder_paths. Or grab it from ComfyUI Manager under "ComfyUI Core Video Nodes."
Why it's useful despite being fake
The value here is conceptual: it teaches you that "which codec is this stream?" is a real question your video pipeline has to answer before it can do anything else, and it shows where that step slots into the graph - right after you've extracted a stream, right before you decode. If you're sketching a workflow or building your own video nodes, that's a useful skeleton. If you need actual codec detection today, that's PyAV or ffmpeg, and on the ComfyUI side VideoHelperSuite (VHS) is the practical route. Like the rest of this pack - two stars, no real community footprint - it's a spec sketch, not a tool.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| video_stream | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| codec | STRING | — |