Editor de Vídeo OnlineEditor de Vídeo Online

How to batch-generate whiteboard videos with Python and ffmpeg

Use Editor de Vídeo Online's advanced Python version to batch-render hand-drawing videos at exactly 30 fps, with configurable hand, duration and format.

By Editor de Vídeo Online TeamPublished 4 min read
Article cover: How to batch-generate whiteboard videos with Python and ffmpeg

Need 20 hand-drawing videos for a course? Or a week's worth of tip videos? Making them one by one in the browser works, but it takes time because recording is real-time. That is what Editor de Vídeo Online's advanced version is for: a Python script that lets you batch-generate videos at maximum quality and exactly 30 frames per second.

What the advanced version does

  • Generates hand-drawing videos from images (that mode only).
  • Processes one image or an entire folder at once.
  • Exports H.264 MP4 at a fixed 30 fps, independent of a browser tab.
  • Lets you set duration, format, sensitivity, brush and hand.

It lives in Editor de Vídeo Online's avancado ("advanced") folder, along with the mao_padrao.png (default hand) and mao_manga.png (sleeve hand) files.

Installation

You need Python and ffmpeg.

Windows

  1. Install Python from python.org and tick "Add Python to PATH" during setup.
  2. In a terminal, run winget install ffmpeg.
  3. In the avancado folder, run:
pip install -r dependencias-python.txt

Mac

brew install python ffmpeg
pip3 install -r dependencias-python.txt

Dependencies are opencv-python, scikit-image and numpy.

Basic usage

One drawing:

python gerar_video.py drawing.png

A whole folder (one video per image):

python gerar_video.py folder_with_drawings/

With another hand and a 40-second duration:

python gerar_video.py drawing.png --mao mao_manga.png --duracao 40

All options

The option names are in Portuguese; here is what each one means:

OptionWhat it doesDefault
--saida (output)Output .mp4 file (or folder, if the input is a folder)Next to the image (a videos subfolder for folders)
--duracao (duration)Seconds of drawing30
--finalSeconds holding the finished drawing at the end2.5
--formato (format)vertical, horizontal, quadrado (square) or originalvertical
--limiar (threshold)Stroke sensitivity, 80 to 240190
--pincel (brush)Brush thickness1.0
--mao (hand)Transparent PNG of the handmao_padrao.png
--ponta (tip)x,y position of the pencil tip in the hand PNG0,83
--baseHand width (without arm) in the PNG, in pixels275
--tamanho (size)Hand scale1.0

Full example in landscape format:

python gerar_video.py drawing.png --duracao 40 --formato horizontal --saida my_video.mp4

With your own hand:

python gerar_video.py drawing.png --mao my_hand.png --ponta 0,83 --base 275

To prepare your hand, see how to use your own hand in the animation.

A series production workflow

  1. Standardize your sketches: same format, same line weight, white background. See how to prepare a sketch.
  2. Name files in order: 01-intro.png, 02-problem.png…
  3. Test one file with different --limiar and --pincel values until it looks right.
  4. Run the whole folder with the same parameters.
  5. Edit the videos in Editor de Vídeo Online's Studio (with Import video) or your favorite editor.

Browser or Python: when to use each

SituationBest option
One video, live visual tweaksBrowser
Vox collage or Paper effectBrowser
Many similar hand-drawing videosPython
Guaranteed exact 30 fpsPython
Computer too slow for real-time recordingPython

Frequently asked questions

Does the Python version make collages?

No. The advanced version is for Hand drawing mode only. Vox collage and Paper effect run in the browser.

Do I need to know how to code?

No. Just run the commands in this guide in a terminal, changing the file names.

Does the video include audio?

No. Add narration and music afterwards in your video editor. See how to add narration and music.

Conclusion

For production at scale, the advanced Python version is the right tool: a folder of sketches goes in, a folder of MP4s comes out. For visual tweaks and other styles, keep using Editor de Vídeo Online in the browser.

Make your animated video now

Editor de Vídeo Online runs in your browser (Chrome or Edge): upload an image, pick a style and record an MP4. Nothing to install.

Try Editor de Vídeo Online →

Editor de Vídeo Online Team
Written by the Editor de Vídeo Online team, the in-browser animation tool for hand-drawn whiteboard videos, Vox-style collages and paper cutout effects.

Keep reading