Author: Xavier Fernández-i-Marín
May 7, 2020 - 9 minutes
Tutorial to create video lessons for higher education teaching: an example teaching RStudio using OBSData visualization
This post explains how to record and publish a video for students, for them to follow a tutorial-like session. It is focused on tertiary education and in showing R and RStudio, but can also be applied to other contexts and software.
The objective is to produce a video that combines auditive explanation with slides/software in a single video:
The great 2020-Covid crisis has brought enormous challenges also to education and stressed tertiary education institutions. The move to online solutions that can temporarily replace class interaction has in many cases . I have myself felt the need to adapt the teaching plans and syllabus to adapt to the new situation.
One of my strategies is to record small videos that in less than half an hour can show the use of research tools, in this case data analysis software like R, in a practical way, without having to be in a classroom presentially and circulating to help students have everything set up and ready with their computers.
I believe that this is a more flexible approach for both students and teachers than sitting together in front of the computer at the same time using some sort of screen-sharing platform.
It allows me to focus on the content. Because I do not have to be looking at whether there are problems following me, I can fully concentrate on my delivery and the technical issues arising from my own setup.
For the students, it helps them by adapting the session to their own learning pace and ability to interact with the computer. They can pause and repeat the video, and don’t have to lose any detail if they are stuck in previous steps.
In addition to this, it makes synchronous sessions (when the students and the teacher are together at the same time) more focused on solving issues and experiences during the process. We only do Q&A during these sessions, making a more efficint use of their time by not wasting it in some of them doing nothing while I solve someone’s personal issues or while we have to wait for part of the group to finish an exercise.
All software presented here is Free Software. Both “free” as in freedom and “free” as in free beer. So no annoying licenses involved or the impossibility to
In addition, the software is multiplatform, which means that it can run in my GNU/Linux computer, as well as Windows and Mac platforms.
- OBS: to record the video and audio.
- Inkscape (optional): to create the structure of the display.
- pdfpc (optional): a presentation software, to display slides, with many options for using a pointer and a focus engine.
- Openshot (optional): to edit the video to create transitions or to add parts together using transitions.
Prepare the canvas
This is an optional step. If you want the logo of the institution where you are teaching to appear, and details about the course (like I show in the image at the beginning of the post), then you need to prepare the canvas to make the adequate changes. If you don’t need it, or want to go ahead, just use this one that I have created, following the rules.
The idea for the canvas is to divide the space between computer space, where you show what you would be doing in class using a possibly a combination of slides / other computer software, and your own image talking and explaining. Because the idea is to show some practical work, then the major window should be dedicated to show what you do with your computer, whereas your own webcam image can be minimal.
Use inkscape to create a canvas with a specific width, height and its ratio (following the final measures of the video that you want to produce). I think that a reasonable option nowadays, and for this purpose is 1280x720, also known as HD, or 720p.
You may want to simply start from the one that I have produced (download it here), and adapt it to your needs, better than to start from scratch. Use your preferred font and your logo. Or start with an empty one.
The key is to divide the space between a colored background and empty spaces with an empty layer, where later on we can accomodate our video streams. We need to export the original SVG format in Inkscape to a raster format. We choose PNG, that allows to have transparent layers, which is what we want.
The final result is this:
Prepare the final output
Now it is time to prepare the composition of the recording. The recording is performed by OBS OBS. The idea is to combine different sources of video input (coming in our case from the webcam plus one program at a time), and the audio input (coming from the microphone), and put them together in a composition within the limits of the transparencies of the PNG file.
But in order for OBS to mix all sources and generate an output, we need to think about the characteristics of the final video that we want to produce, so that OBS can manage all the inputs and combine them into the output in real time.
The easiest way is to simply use the auto-configuration wizard, by clicking on “Tools” and “Auto-configuration wizard”. OBS will try to guess the settings adequate to your computer.
But if you want to tune it to our needs, then it can be done through the “Settings” option under the “Files” menu. In this case, we need to consider the audio, the video and the output. Let’s start with the simplest one, the audio. You basically want OBS to accept the highest possible degree of quality in the input. Therefore, in my case I have used the sampling at 48khz. See the screenshot. In case of doubt, leave the default.
Next, consider your video input. This is the quality of the webcam, basically. If possible choose at least the FPS (frames per second) equal to the number of FPS that you want in your final video. 25 is adequate to the type of project that we are performing. There is no need for higher framerate. And lower framerate can make some parts of the slides or RStudio a bit blurry.
Finally, the most important part is to wisely choose the details of the final output. Again, for our purposes a reasonable setup is to define an output quality of “High quality, medium file size”, “mkv” as the encoding format, and the “x264” encoder.
Prepare the video recording
So once OBS is launched and ready for the mix, let’s incorporate the different input sources (video from the webcam, audio from the microphone and recordings from different programs). This is done using the “Sources” part of the OBS screen, by clickin on the “+” to add any one of them:
- First add an “Image” with the PNG that delimits the space of the recording. Label it to something understandable. In my case, I have used “Portada” (cover in catalan).
- Then, add a microphone and label it as well.
- Third, add the webcam that is usually labelled as a “Video capture device”.
You have so for the main blocks. Now the rest of them are streams of video coming from the behaviour of different programs. This may vary in other systems (Windows or Mac), but I prefer to use “Window capture” for the following:
- Slides. I use pdfpc, but you may want to have another software that helps you with the slides. Notice that the slides must always be visible (as indicated by the “eye” icon in the “Sources” menu.
- RStudio. In my personal case, this is the main place where I show students how to write R code in a practical way (even though I not work with RStudio). It is the window where I spent most of my time in the videos (or where I should spent most of the time, as the purpose, remember, is to provide practicall skills.
- Browser. I keep a browser opened with pages that I may want to show.
- Spreadsheet. I also tend to have Libreoffice opened in case I need to show specific details using a spreadsheet grid.
Add them one by one. Once the slides are introduced, resize the window to the assigned size in the cover.
One option that works for me is to change the scale filtering to “bicubic”, otherwise the output is blurry and of very low quality.
There is not much that I can say here. Keep a good script at hand, either in paper with your notes, or rely on the slides. I use VIM to create an outline and keep it opened with my notes. I have found that the notes in the slides are diffifult to follow when there are so many other programs opened that you need to switch.
The idea is that the slides source is always on, and then you “mute” or “unmute” (by clicking on the “eye” icon) any video source depending on whether you are showing and discussing slides, or a practical exercise using RStudio.
To record, simply press “Start recording” in the OBS button in the right-hand side of its user interface, and “Stop recording” to stop it once you are done. That’s all.
I personally prefer not to have to edit the videos, but if you feel that you need to add some seconds at the beginning with the video details, and to include transition between the parts, simply play with Openshot. For a simple concatenation of streams (for instance, if you break the recording of your session into different parts), ffmpeg is enough:
ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mkv
mylist.txt is a file containing the names of the different streams of
video in the order that we want them processed into the final “output.mkv” file.
file 'session-01-part-01.mkv' file 'session-01-part-02.mkv'
Upload and share the result
The final destination of your video is up to you. You can opt to upload it to Moodle or any other learning platform that you are using. Or you can also choose to upload it to a webpage. In my case, I prefer the last one. I use Vimeo, and I upload the videos using a password that I later provide the students.
Complement the tutorial
The objective of the tutorial isn’t just to display information or “pass some knowledge” to students, but rather to empower them to produce their own outputs. Therefore, these video tutorials must always be accompanied by exercises where you ask them to produce specific outputs using the material that you have provided.