Drawing on Videos Using Free Software
This is a tutorial on how to draw on videos with Kdenlive (and other tools). There exists another tutorial which goes over how to draw stuff on top of videos, but the drawings are all static. You can't show the actual process of drawing.
I needed to use this technique in one of my recent videos, but in a fashion where you can actually see the process of drawing, as a video layer of its own, almost. So, I had to come up with a method that would make that possible, and I did. I was also able to do it using only free software. Here it is, feel free to use it yourself.
What you'll need for this:
- A computer which can handle all three of these running at the same time
- Multiple Monitors/Drawing Tablet (Optional, but will make things easier)
Step 1: Extract The Image
Go into Kdenlive, open your project, import your clip, and get to a point where you're ready to begin. From there, pick the spot in the video you'd like to begin drawing and navigate to that in playback. When you've reached a good spot, right click on the video in the Project Monitor and select “Extract Frame to Project”.
This will take the current frame in the sample video, with all its layers, and export it to a PNG. You file manager will open, asking you where to save it, so save it somewhere you can find it. You'll also notice the image has been added to your project. We will come back to this later.
Step 2: Set Things Up in GIMP
Take this image, and open it up in GIMP.
Set up your primary color in GIMP to be a bright red (#FF000).
Select the paintbrush tool and set the size appropriate to what can be seen but also allow you to write legibly. Remember that the canvas is the same size as the video itself, so adjust accordingly. For a 1080p video, I keep my brush size between 10 and 20px.
Next, select Colors on the toolbar, and in the drop-down, select Colorize. Change the Colorize color to lime green (#7CFF19), and select Ok. Your image should now be colored in bright green.
Lime and red are used because they contrast very heavily. We're going to eventually take advantage of a green-screen effect of sorts, so we want colors that Kdenlive can clearly distinguish between as what to ignore and what to show.
Finally, create a new layer and select, as this is the layer we're eventually going to be drawing on.
Step 3: Set Things Up in OBS
Once that's done, open OBS in a separate window and create a New Scene with a new Window source.
After creating a Window Capture, you'll see a settings menu pop up for your newly created source. It's going to ask you for which window to capture, select the one titled either GIMP or “GNU Image Manipulation Program” (same thing).
In the settings there's also some options to crop. Adjust these numbers until your window is showing only the image in GIMP with no borders or menus surrounding it. Try adjusting the zoom on the image in GIMP too if you need.
The idea is that we're going to use the capture of the image as a video feed, so we want the whole image and nothing but the image. Make sure to also de-select “Capture Cursor”.
Step 4: Record
Hit Start Recording in OBS when you're ready, and switch over to GIMP and begin drawing using your red.
Remember that this is a screen recording, so everything you do will be captured on video, but also you're able to edit it later if you need to to either cut out pauses or splice together recordings.
When you're done, hit Stop Recording and pay attention to where your file gets saved. If you don't know, you can go into the Output section under Settings in OBS to find out.
Step 5: Import
Import the recorded video into Kdenlive, and place it beginning at where you want the drawing overlay to begin.
When you're dragging the clip onto the timeline from the Project Bin, make sure you click on the film icon next to the video clip before dragging to ensure you're only importing in the video portion of the clip. Otherwise you'll have to Ungroup the clip and delete the audio portion.
Under Effects, search for “Chroma Key: Basic” and drag it onto your clip in the timeline.
Make sure your video playback pointer is over your clip, then click on it to pull up its effects in the Effects menu. Within the Chroma Key: Basic options, there is an option called Color Key. Set this value to the same lime green as earlier (#7CFF19).
Keep adjusting Variance until you find the smallest value which only leaves behind the red drawing layer. I found mine working in the 500-600 range, but it can vary. The higher the variance is, the more it removes. If it's too low, it'll leave behind extra stuff we don't want, if it's too high, our brushstrokes may look too thin.
From here, play it back to see whether or not you're satisfied. You can do multiple of these recordings, cut out bits, splice them together, speed them up or slow them down as you see fit in Kdenlive.
Step 6: Done!
And with that, you're done! That's all there is to it, it's a bit janky, but it gets the job done. So far, it's the only solution I've seen for this specific editing technique, and it's done using all free software.
If you have any questions, you can contact me on Mastodon. The footage I used in this tutorial was taken from the SuperTuxKart 1.3 Trailer.