โ๐น FFmpeg Configuration ๐นโ
One node to set codec, quality, and format for every video node
- FFMPEG_CONFIG_JSON
This node doesn't touch any video itself. It's a settings hub - you configure your FFmpeg encoding options once (codec, container, quality, resolution, audio, framerate), and it outputs them as a single FFMPEG_CONFIG_JSON string that the pack's actual video nodes consume. Instead of setting quality on every Convert Video, Concat Videos, or Concat from List node individually, you set it here and wire this one config into all of them.
It's the "define once, apply everywhere" pattern for the Bjornulf video pipeline. If you find yourself re-typing the same codec and CRF on multiple nodes, this is the fix.
How it works
You fill in the encoding parameters you care about, and the node serializes them into a JSON blob. The consuming nodes (Convert Video, Concat Videos, Concat Videos from List) accept that blob on their FFMPEG_CONFIG_JSON input and translate it into actual FFmpeg flags. Think of it as a preset object passed by wire.
The inputs that matter
There are a lot of inputs, but a beginner only touches a few:
container_format- the output wrapper:mp4,mkv,webm,mov,avi(defaultmkv).mp4for maximum compatibility,webmif you need transparency.video_codec- the encoder.libx264 (H.264)for universal playback,libx265 (H.265)for smaller files (the default), or the*_nvencoptions to encode on an NVIDIA GPU (much faster). There's alsocopyto avoid re-encoding.crf- quality, where lower means better and bigger (1โ63, default 10). Around 18โ23 is a sane range for H.264/H.265; the default 10 is very high quality and large.preset- encoding speed vs. compression efficiency (ultrafastโฆveryslow, defaultveryslow). Slower = smaller file for the same quality. Drop it tofastormediumif encoding is taking forever.
The rest are opt-in and gated behind their own enable toggles: pixel_format, force_fps, resolution override (enabled_change_resolution + width/height), audio settings (enable_change_audio, audio_codec, audio_bitrate), a static video bitrate (enabled_static_video_bitrate + video_bitrate), force_transparency_webm, and ffmpeg_path if your FFmpeg isn't on the default PATH. Leave the disabled ones alone until you need them.
Output is a single FFMPEG_CONFIG_JSON string. Fan it out to every video node you want governed by the same settings.
How to install it
ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
pip install -r Bjornulf_custom_nodes/requirements.txt
Restart ComfyUI. You also need FFmpeg installed and on your PATH - the config node just describes settings; the real FFmpeg is what does the work.
Common issues
A few traps. If you pick an *_nvenc codec without a compatible NVIDIA GPU (or the right drivers), encoding fails - fall back to libx264/libx265. If you pick a codec/container combo that doesn't match (say VP9 in an mp4), FFmpeg complains; when in doubt, H.264 in mp4 just works. The default crf 10 + veryslow preset produces gorgeous, enormous, slow-to-encode files - for everyday use, bump CRF toward the high teens and loosen the preset.
And the standing caveat for all the pack's video/FFmpeg nodes: they're built and tested mainly on Linux, per the author. On Windows, set an explicit ffmpeg_path if the node can't find FFmpeg, and don't be surprised by rough edges. The author also rewrote the FFmpeg nodes heavily over several releases, so stay on a current version.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| ffmpeg_path | STRING | ffmpeg | โ |
| container_format | COMBO | mkv | 6 options: None, mp4, mkv, webm, mov, avi |
| video_codec | COMBO | libx265 (H.265) | 9 options: Auto, copy, libx264 (H.264), h264_nvenc (H.264 / NVIDIA GPU), libx265 (H.265), hevc_nvenc (H.265 / NVIDIA GPU), +3 |
| preset | COMBO | veryslow | 10 options: None, ultrafast, superfast, veryfast, faster, fast, +4 |
| crf | INT | 101โ63 | โ |
| pixel_format | COMBO | yuv444p10le | 8 options: None, yuv420p, yuv444p, yuv420p10le, yuv444p10le, rgb24, +2 |
| force_fps | FLOAT | 0.000โ240 | โ |
| enabled_change_resolution | BOOLEAN | false | โ |
| width | INT | 00โ10000 | โ |
| height | INT | 00โ10000 | โ |
| enable_change_audio | BOOLEAN | false | โ |
| audio_codec | COMBO | aac | 7 options: None, copy, aac, libmp3lame, libvorbis, libopus, +1 |
| enabled_audio_bitrate | BOOLEAN | false | โ |
| audio_bitrate | STRING | 192k | โ |
| enabled_static_video_bitrate | BOOLEAN | false | โ |
| video_bitrate | STRING | 3045k | โ |
| force_transparency_webm | BOOLEAN | false | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FFMPEG_CONFIG_JSON | STRING | โ |