Instructions to create videos with Google Notebook LLM

This is a guide on how to generate educational videos in Finnish with English and Finnish subtitles. This guide uses Google's Notebook LLM tool to generate the videos.

This guide is split into two parts. Generating the videos and then editing the videos to adjust playback speed and add subtitles.

Creating a video

Opening a new notebook

Notebooks pic

A new notebook has three sections. From left to right these are:

Uploading and selecting materials

Notebook accepts presentations, word documents, videos, and many other file formats. Once the files have been uploaded, it's possible to select which materials Notebook uses to generate the video. Below there are lecture slides in PDF format and an mp4 video.

selected materials

Notice that only the video has a check next to it. This means that the source is currently selected. When Notebook generates a video, it will only use the selected materials to create it, so by selecting certain materials it's possible to narrow down on what the video will focus on.

Creating videos

In the studio section, press the video button and a window will appear where it's possible to specify the following things:

Video window

Once all the settings have been set the video can be created by pressing the generate button. Generating the video will take a couple of minutes and once it's done it can be downloaded.

Editing the video

I used the ffmpeg command line tool to edit the videos. You can download ffmpeg from here.

Adjusting the speed

The speed at which the AI narrator talks is a bit too fast in my opinion, so these additional steps help by slowing down the video. Navigate to the folder where you have saved the video you want to edit. The speed of the video can be changed with the following ffmpeg command:

''' ffmpeg -fflags +genpts -i originalvideo.mp4 -filter:v "setpts=2.0*PTS" -filter:a atempo=0.5 outputvideo.mp4 '''

The above commands creates an output.mp4 video that is the same as the originalvideo.mp4 but with the speed of the video halved. By adjusting the values in "setpts = X * PTS" and "atempo = Y" the pace of the video can be changed. Be aware that the setpts and atempo changes should match each other so that Y = 1/X. For example, if the video should be slowed down by 10% then these would be the X and Y values:

''' "setpts=1.1*PTS" -filter:a atempo=0.91 output.mp4 '''

Adding subtitles

To add subtitles, you need to create a .srt file. This file type is used for subtitles and is essentially a text file with timestamps which are used in order to display text at the correct moment in the video. To create a .srt file, upload the generated video to Google's Gemini and ask it to create an .srt file for the video in English and Finnish. You can upload files by pressing on the + sign at the bottom right of the chat.

Gemini chat

Move the srt file and the video to the same folder. Then run the following ffmpeg command to add subtitles:

''' ffmpeg -i video.mp4 -vf "subtitles=subtitlefile.srt:force_style='FontName=Helvetica,FontSize=14,PrimaryColour=&H00FFFFFF,OutlineColour=&H000000,BackColour=&H32000000,BorderStyle=1,Outline=1.5,Shadow=0,MarginV=10,Alignment=2'" -c:a copy videowithsubtitles.mp4 '''

Let's break the command down so we know what each part does:

Thank you for reading

Below you can find an example video created for Aaalto's Basic Principles in Networking ELEC-C7420 course

If you have any questions you can email me at ruusrai@proton.me