Loading...
Loading...
End-to-end workflow for automatically generating complete whiteboard animation videos from SRT subtitle files. It completes three phases in sequence: storyboard parsing, image generation, and video generation. It is triggered when the user provides an SRT file and requests to generate a whiteboard animation video, or says "generate whiteboard video from subtitles" or "whiteboard video workflow".
npx skill4agent add yangagent/whiteboard-animation-skill whiteboard-video-workflow| Parameter | Required | Description |
|---|---|---|
| Yes | Absolute path of the SRT subtitle file |
| No | Output root directory, defaults to the directory where the SRT file is located |
scripts/check_env.pypython3 <skill-dir>/scripts/check_env.pyPYTHON_PATH=<path>ENV_RESULT=...Whiteboard animation video generation requires RunningHub API to call AI models to generate images first. You need to configure the API Key in thefile under the skill directory..envFix method:
- Add a line to the
file:<skill-dir>/.envRUNNINGHUB_API_KEY=your API key- If the file does not exist, create it first
- The API Key can be obtained from RunningHub
- Rerun after the configuration is complete
Whiteboard animation relies on Python libraries such as OpenCV, NumPy, and PyAV to process videos. Automatic installation failed.Fix method:
- Please confirm that your Python version is 3.9 or higher
- Then rerun this workflow, and the script will try to install automatically again
outputDirsrtPathoutputDirscripts/workflow_helper.pypython3 <skill-dir>/scripts/workflow_helper.py init-dirs "<outputDir>"storyboardDirimageDirvideoDirUse the Read tool to read the file, and execute according to the workflow steps in it.<replace this skill directory with the actual absolute path>/references/storyboard-parser.mdInput parameters:
- srtPath =
<replace srtPath with the actual absolute path>- projectRoot =
<replace storyboardDir with the actual absolute path>- skill-dir =
(used to locate scripts)<replace this skill directory with the actual absolute path>Return the absolute path of storyboard.json and the number of scenes after completion.Note: The main agent must fill in the actual path value into the instruction, do not pass the variable name, the subagent cannot access the context of the main agent.
scripts/workflow_helper.pypython3 <skill-dir>/scripts/workflow_helper.py gen-prompts "<storyboardJsonPath>"durationUse the Read tool to read the file, and execute according to the workflow steps in it.<replace this skill directory with the actual absolute path>/references/image-generator.mdUse batch mode, pass the following JSON string array as the prompt parameter:<paste the actual content of the prompt JSON array output in Step 4 here>Parameters:
- skill-dir =
(used to locate scripts)<replace this skill directory with the actual absolute path>- Output directory =
<replace imageDir with the actual absolute path>- Aspect ratio = "16:9"
Note: The main agent must fill in the actual prompt content and path value into the instruction, do not pass the variable name, the subagent cannot access the context of the main agent.Important: Return the list of paths of all generated images, and the order must be consistent with the order of the prompt array.
Call the whiteboard-animation skill, use batch mode. Skip environment pre-check (the main agent has confirmed that the environment is ready), and run the batch generation script directly:<replace PYTHON_PATH with the actual value obtained in Step 0> <replace the whiteboard-animation skill directory with the actual path>/scripts/batch_generate.py \ --images <imagePaths[0]> <imagePaths[1]> ... \ --durations <durations[0]> <durations[1]> ... \ --output-dir <absolute path of videoDir>The main agent must fill in the actual absolute path ofand the skill directory into the instruction, do not pass the variable name, the subagent cannot access the context of the main agent.PYTHON_PATHParameters:
: List of image paths arranged in storyboard order (separated by spaces)--images : List of durations corresponding to images one by one (unit: milliseconds, directly use the duration value in the storyboard, no conversion required)--durations :--output-dir<absolute path of videoDir>Important: After completion, collect all generated video file paths in thedirectory, sort them by file name timestamp, and return the complete video path list to the main agent. The order must be consistent with the order of input images.<videoDir>
scripts/workflow_helper.pyPYTHON_PATH<PYTHON_PATH> <skill-dir>/scripts/workflow_helper.py merge-videos "<outputDir>" <videoPath1> <videoPath2> ...mergedVideototalSegmentssizeMB{
"mergedVideo": "/path/to/output/白板视频_20260329_120000.mp4",
"videoSegments": [
"/path/to/video/vid_20260329_120000_h264.mp4",
"/path/to/video/vid_20260329_120010_h264.mp4"
],
"totalSegments": 2,
"sizeMB": 15.3,
"outputDir": "/path/to/output"
}check_env.pyPYTHON_PATHstoryboard-parser.mdimage-generator.mdcheck_env.pyworkflow_helper.pyinit-dirsgen-promptsmerge-videosgenerate-storyboard.pygenerate-image.pybanana_prompt_template.py