 So if we want to record a screencast there are two streams again this the stream of audio usually from your microphone input and The stream of video from your screen That is your monitor For recording the audio. I'll use a program called socks SOX and the actual command is called REC for record and We can use ffmpeg to do the same thing, but let's just use something different And I'll just go straight to the command for recording audio It will not be very successful on your computers if you have no audio input, but We'll give you the command anyway REC for record it tells socks to record from the microphone You specify the sampling rate with recording audio We take the analog input and sample it and convert those samples into binary So what's rate do we sample 44 kilohertz or 44,100 Hertz is a common rate That's what that's specifying and every sample becomes 16 bits minus B16 and with How many channels do we want? Stereo's two channels mono is one most microphones are mono so one should be enough Of course, they're multiple more than two channels with different audio systems And save as a file and Flak is a format for lossless audio it loses no quality. So it's probably the best in terms of The original recording of audio You can later convert it to other More or convenient files if you need and run the command Will it work on this computer? It's running, but it's running on computer for Not very useful at 24 See if I can run it on my laptop and it's recording Note that so now on this screen, which is not what you see on your marks, but this is so This is computer 24 back in the corner. There's no audio This is my laptop. There is audio in because it's coming from the sound system and you see as I talk Some very basic feedback of the audio strengths Going up and down so it's recording some audio fine and we can stop that Control C will stop the recording and we'll see that my audio dot flak file is 1.7 megabytes. Okay, so that was the recording of audio easy. We can record audio Just to check we can look at the audio Audacity just opens up this file in a Audio editor, so there it is. Okay, so Waveform representation of that 30 seconds or so of audio that I recorded Of course, you need an audio input to record that so a microphone for example If anyone's really interested, there's one microphone Here Sure, you'll find Not so interesting now the screen so recording audio is relatively easy now We want to record the screen Who exited the mind? Okay, I'll I'll stay for now on my laptop because Just one minute someone has a question for me. She's gonna give us money for lunch, so I better answer Let's try and record the screen to What I'm doing now is on the Laptop so you cannot follow it on your on your screen. You have to look at the actual screen I'll zoom in a little bit more We can use ffmpeg as well as other programs to record the screen. Let's show you with ffmpeg We want to record from a special device. Okay, normally with ffmpeg. We can specify. Where do we get the video from? Well, we use the minus f option and it's called x11 grab because in in Unix Linux the the display is run by software called x11 so what this tells ffmpeg to do is to grab Everything on my display on my screen, but we should specify some other things. How fast should we grab my screen? So I can specify a rate Video is done in frames per second. How many frames per second do I want to record? Well, I can set whatever I prefer 10 for example Every second ffmpeg will take really a screenshot of my computer take 10 screenshots of my computer every second And that will be combined to be a video. I can specify the size and Usually if I remember the resolution of my monitor So that may change on different computers So the size if I want to capture the entire screen the resolution of the monitor with a display This one will make more sense in a moment minus I Is just some notation for With monitors you may have multiple displays And in fact, I do have multiple displays set up my laptop plus the projector, but we can deal with that later These are just the defaults We'll see them change in a moment So this is saying record My screen at a rate of 10 pictures per second 10 frames per second because video is just pictures at a changing rate a changing and of some size some resolution and Now I want to use a video codec to encode it Create an output and a common and quite good in terms of performance codec is H.264 and the implementation on Linux is using library x264 lib x264 That codec has some options and these I don't always remember, but I'll just copy When we are recording the screen. We want to do it quickly. We don't want my CPU to slow down trying to create the video So we set some options to be ultra fast That is maybe lower quality, but it would be faster in encoding and some other quality indicators CRF zero. I think it was Something else Again, this is on the website. So I better go have a look to remind myself It's this command and I think then we're done and then the file that we want to create mp4 Record from the display at a rate of 10 frames per second at the resolution specified Doesn't work the minus I zero dot zero Refers to the display so the the window the operating system you can refer to different displays Like you can have multiple monitors Okay You have only one so I think you can even omit this parameter But this is the default But I'll change it in a moment because when you have to you can specify the offset This zero comma zero specifies the offset from the top left corner of your screen of where you want to record If you don't want to record your whole display You can reduce the size and Add an offset here so that for example you record the just this portion of the display and that's what we use it for in the moment See if it works It's recording. How do you know it's recording my laptop screen and to stop control C and Now open it and just see if it did actually record It's come up on my This is the recording of my laptop screen. I Shifted around you didn't see it because I have two monitors set up It's what's actually on my laptop screen not on the projector that was recorded So now let's do a slight variation and I want to record With my setup, I've got two monitors laptop plus projector and That's set up that they're side-by-side Laptop and then next to that is the monitor is the projector. I want to record just the projector From the output of my graphics card just the projector so I can modify that to specify Set the size to be the resolution of the projector and Set an offset to be the size The horizontal width of my laptop screen It's a bit confusing but imagine and there's picture on the website Here's my laptop screen. Here's the Here's the projector So with respect to this software, it's one big display So I want to record a resolution of a thousand twenty four by seven six eight and an offset from the top left of 1366 so the top left is here go across one three six six and then record At the resolution specified that is record this part of the display So it just records what's projected not what's shown on my laptop over right. Yes And I move around and you should see when we stop the recording what we're you're seeing right now Now I'll open that Okay, so this Recording is what was shown only on the projector not what's shown on my laptop screen because the display is extended It's not mirrored. So the last step so we can record audio easy. We can record the screen now Easy we want to can record both of them at the same time How do you do that? Just start them at the same time Start the recording of the audio and the video at the same time and Then after that you can combine them to get a video of your format of your desire But I think with time being a bit after three How do you combine them? That'll be a task for you to do when you go home this weekend Okay, you'll see on the website the command for recording the screen Then the extension if you've got multiple monitors if you want to record say I have a laptop and project If you want to record just the projected image not your laptop as well Then you can follow the command to do do that of course if you mirror the display Same on laptop as projector. This is not an issue If you don't mirror them like I'm doing in this lecture, then you need to specify some offset as to what you want to record then the next step is Do them at the same time And the way I do it is just put them in a script and run that at script Record the audio record the screen and a little bit of other mess here Such that they will stop when I stop the script So you start the script the script starts recording your audio starts recording your screen and In this case when you press Z It was stopped recording both of them and exit the script You may download that script and the the extended one and try it You can either do it on these computers. You can download it. I think it's downloaded in the ITS 332 directory You may try Screencast is the name of the script net lab tests It may work on your computers right now The last step once you have both the audio stream and video stream you combine them using ffmpeg to create a Video that contains both of them and the last few commands Show you how to do that, but I think you can work that out on yourself