media_frames_to_mp4
Convert PNG or JPG image frames into an H.264 MP4 video for COMSOL animations, with options for frame rate, quality, titles, scaling, and frame holding.
Instructions
Compose PNG/JPG image frames into an H.264 MP4 (imageio + imageio-ffmpeg).
Requires imageio and imageio-ffmpeg (check media_tools_status). Frames are padded to even dimensions automatically (H.264 requirement).
Args: frames: list of image paths or a one-element frames directory list. output: output .mp4 path (auto-generated when omitted). fps: frames per second (default 10). quality: imageio-ffmpeg quality 0..10 (8 = good, default). title: optional title text drawn on every frame. title_position: "top" (default) | "bottom" | "overlay-top" | "overlay-bottom". max_width: downscale frames wider than this. max_frames: keep at most this many frames (evenly spaced). hold_last_s: extra seconds to show the last frame.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"frames": "<frames>"
},
"name": "media_frames_to_mp4"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | ||
| title | No | ||
| frames | Yes | ||
| output | No | ||
| quality | No | ||
| max_width | No | ||
| max_frames | No | ||
| hold_last_s | No | ||
| title_position | No | top |