Skip to content

Simple video editing tool to automate creation of tutorials

Notifications You must be signed in to change notification settings

OGStudio/tutorial-tool

Repository files navigation

tutorial-tool

tutorial-tool is a simple video editing tool to automate creation of tutorials by combining text and video

Here's a preview of a result:

Preview

Table of contents

  • Python
    • tutorial-tool is a small Python application
  • Image magick
    • Is used to produce still images that describe tutorial steps. Still images are generated from a step's text and background image
  • MLT
    • Is used to combine still images and video parts into single video

macOS

  1. Install Homebrew
    • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install Image magick
    • brew install imagemagick
  3. Install MLT
    • brew install mlt
  4. Install tutorial-tool
    • Download it from GitHub and move to desired location

TODO Windows

  1. Install MSYS2?
  2. Install Image magick
  3. Install MLT

TODO Linux

  1. Install Image magick
  2. Install MLT

Note: you may use mplayer to get timestamps in seconds of original video

Here's the usual workflow of making a new tutorial video:

  1. Create one or several videos of something you want to combine into a tutorial
  2. Convert the video with MLT to 25 FPS
    • melt -verbose -profile atsc_720p_25 source_video.mp4 -consumer avformat:destination_video.mp4 vcodec=libx264
  3. Create background image with 1280x720 resolution
    • You can do it with software like GIMP.
  4. Prepare the script to build final video
  5. Bake the video
    • /path/to/tutorial-tool /path/to/script | sh
    • Note: tutorial-tool only prints Bash commands for you to execute, so you have to redirect tutorial-tool output to the shell
  6. Get the resulting video in your temporary directory

Here's an example script:

background bg.png
text 5 Let's install Blender
video 0:6 install_blender.mp4
text 5 Installing it with apt
video 6:26 install_blender.mp4
text 5 We're still installing it
video 26:56 install_blender.mp4
text 5 Congratulations! We just finished installng Blender

This script contains all supported language constructs:

  • background [image]
    • Specifies background image to use for text
  • text [seconds] [text]
    • Specifies text to render for desired number of seconds
  • video [seconds_start]:[seconds_end] [video_file]
    • Specifies video_file part that starts at seconds_start and ends at seconds_end

Here is the resulting video at YouTube.

  • Save video frames, one for each second
    • mkdir frames
    • ffmpeg -i video.mp4 -vf scale=640:-1:flags=lanczos,fps=1 frames/f%03d.png
  • Convert video frames to GIF
    • convert -loop 0 frames/f*.png output.gif
  • Crop video
    • ffmpeg -i in.mp4 -vf crop=1024:768:0:0 -c:v libx264 -crf 0 -c:a copy out.mp4

About

Simple video editing tool to automate creation of tutorials

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages