SuperAPI AI Directory

Code2Video - An AI Teaching Video Generation Framework Launched by the National University of Singapore

Author: AI小集 · Original source: AI工具集

What Is Code2Video

Code2Video is an AI teaching developed by the Show Lab team at the National University of Singaporevideo generationframework that automatically generates high-quality educational videos through Python code. The core innovation lies in its three-agent collaboration model: the Planner is responsible for transforming knowledge points into a structured storyboard, the Coder converts the storyboard into executable Manim code, and the Critic optimizes the visual layout. Compared with traditional video generation tools, it performs better in knowledge transfer efficiency (a 40% improvement on the MMMC benchmark) and visual stability, making it especially suitable for fields such as mathematics and programming that require precise visual expression.

Code2Video

Main Features of Code2Video

  • Code-centric generation paradigm: uses Manim code as a unified medium to realize the temporal sequence and spatial layout of the video, ensuring that the content is clear, coherent, and reproducible.
  • Modular three-agent collaboration: the planner (storyboard expansion), coder (debuggable code synthesis), and critic (layout optimization) work together to achieve structured video generation.
  • Multi-dimensional evaluation system: comprehensively evaluates generation quality from the perspectives of efficiency, aesthetics, and end-to-end knowledge transfer effectiveness (such as TeachQuiz and AES metrics).
  • Flexible generation scripts: supports single-concept and batch video generation, and allows configuration of parameters such as API selection, output directory, and parallel processing.
  • Rich visual resource integration: combines APIs such as IconFinder/Icons8 to obtain materials such as icons and enhance the visual effect of the video.

Technical Principles of Code2Video

  • Code-centric generation paradigm: uses Manim code as a unified medium and controls the temporal sequence and spatial layout of the video by generating executable animation scripts (rather than directly manipulating pixels), ensuring that the content structure is clear and reproducible.
  • Multi-agent collaboration framework: works through the collaboration of three modules: the planner, coder, and critic:
    • Planner: parses the input content (such as text or concepts), generates a storyboard (shot script), and clarifies the logical structure of the video and the sequence of key frames.
    • Coder: based on the storyboard, calls an LLM (such as GPT-4) to generate animation code that conforms to Manim syntax, and supports dynamic debugging and iterative optimization.
    • Critic: checks the layout and visual consistency of the generated code, and corrects errors through a feedback loop (such as object position conflicts and unreasonable animation timing).
  • Manim engine rendering: the generated code is rendered into video through the Manim engine, using its vector graphics processing capabilities to achieve high-precision mathematical formulas, dynamic charts, and smooth animation transitions. The rendering process includes frame splitting, transformation, quantization, and entropy coding, and finally outputs formats such as MP4.
  • External resource integration: combines icon libraries (such as IconFinder) and multimedia APIs to automatically insert visual elements (such as icons and backgrounds), enhancing the richness and aesthetics of the video.
  • Evaluation and optimization mechanism: uses metrics such as TeachQuiz and AES (automatic evaluation system) to evaluate generation quality from multiple dimensions, including knowledge transfer accuracy, visual fluency, and user learning outcomes, and iteratively optimizes the code generation strategy.

Code2Video Project Address

  • Project official website:https://showlab.github.io/Code2Video/
  • Github repository:https://github.com/showlab/Code2Video
  • arXiv technical paper:https://arxiv.org/pdf/2510.01174

Application Scenarios of Code2Video

  • Educational Teaching Video Generation: Teachers can quickly transform abstract knowledge (such as mathematical formulas and physical laws) into dynamically visualized teaching videos, enhancing knowledge transfer efficiency through animated demonstrations and step-by-step explanations. It is suitable for K-12, higher education, and vocational training.
  • Scientific Research and Academic Presentations: Researchers can generate animated technical principles, simulated experimental workflows, or video presentations of paper results, helping to intuitively display complex models (such as algorithm workflows and scientific experiments) and enhancing the clarity and appeal of academic communication.
  • Corporate Training and Skills Teaching: Used to produce standardized operating guides (such as equipment use and software tutorials), safety specification demonstrations, or product training videos, ensuring content accuracy and consistency through code control and reducing training costs.
  • Personalized Learning Content Creation: Generate customized videos according to learners' needs (such as language learning and programming instruction), and combine interactive elements (such as embedded exercises and dynamic feedback) to adapt to different learning paces and levels.
  • Popular Science and Knowledge Dissemination: Media organizations or creators can quickly generate popular science animations (such as explanations of astronomical phenomena and recreations of historical events), transforming professional knowledge into video content that is easy for the general public to understand, and enhancing the interest and reach of popular science works.