 So here I have two videos of me. This is me actually getting some loquats from my loquat tree At first glance they may look like pretty much the same video But as I walk around notice that the video on the left is Significantly more shaky the video on the left is actually the default I mean, it's the raw footage and the video on the right I actually didn't use a video editor for this or at least not a traditional one not a big program I actually just used ffmpeg now I did not know this until I don't know the past day or so but there is actually an ffmpeg package or I guess library I should say it's called vid.stab and it will stabilize videos All you have to do is give it some arguments on the command line and it will run and stabilize videos now This is nice for me because for the longest time I have been making shaky videos and I've been annoyed by it But now there's an easy way for me to fix it without doing it manually Now here's the module. I just mentioned vid.stab all you have to do and the great thing about this is I can totally automate it I don't have to worry about you know I don't even have to go into a program and click on stuff all you have to do is write a little script that runs two commands First you have one that goes through it and gets all the shit You know detects all the shakiness and then you can just run another command to actually use that Data to reconfigure the original video something like this. So that's all I did I have a actually played around with the options to this that much But in this video I want to talk about some of the other things I do with ffmpeg because a lot of people will ask me How I do video editing so in stuff? But I really don't use an editor. I just use ffmpeg to do most things now one thing I do in nearly every video if you notice really closely You'll notice that my picture down here is actually off sync by default when I'm recording This is how it looks the raw data looks when I record a video It's actually the the video is actually a little off because this thing down here is actually just a window directly It's an MPV instance directly from my webcam and so it's gonna be slightly delayed So let me show you what it looks like when it's not delayed. Let me actually get it back to normal So here's what it looks like when it's in sync now You know, I'm not a little behind the audio in my my video down here How we get it in sync is actually an ffmpeg script It's called as a little script that I call I have called a fix audio and all it does if you look at what? What this does I'll explain it basically you take an input file and you just say okay Let's offset the audio or the video by just a fraction of a second since our video is gonna be Behind we want to cancel out that delay by just delaying it just by a little bit now None of the other stuff is gonna be perceptible perceptible, but it just gets my face in sync. Okay So that's just it's just a simple command that I run pretty much every time I do a screencast I don't have to think about it now. Of course if you asked me all the specifics I always get confused whether our commands with map and stuff like that in ffmpeg But the great thing about it is even the ffmpeg is a very big world You can easily put things in scripts so you can automate stuff all the time Additionally, one other thing I have the script do is that when I record I record in a way I usually record audio in flak So it's lossless and I forget what I actually record my video in but it is something that is not very good for uploading Google if I upload to YouTube It's gonna be a really big size and stuff like that and it's also my internet here is terrible So I like having a small file size so I actually changed the video codec and the audio codec So they're better for internet use. Okay. Now. I like doing this in a separate script You might say why don't I just record in that well It's because recording if I were to record in the this natively a lot of times It's more intensive on my CPU. I don't use a capture card I just live without it. So This is actually what I run pretty much on all my scripts when I want to upload them So that's an ffmpeg thing and I might integrate as well stabilization to my other videos This is for my screencasts. I don't usually need stabilization in that but when I'm walking around with my camera It's nice to have that Additionally one other thing that you actually saw an example of is at the very beginning where I had those two videos of Myself walking around that was actually created in the ffmpeg I did not use a video editor for that whatsoever All I did is this command here. What you can do is I had two files I had the original loquat file Which is I guess on the right and then the stabilized one which I created with that ffmpeg command sort of around here and then I can just take them as inputs and put them through the HS stack or H stack. I should horizontal stack Filter so that will allow them it allow you to put them in a one video so you can watch them at the same time So that's all I did for that and in addition, let's say I want to combine two Two videos, so let's say let's look at all the videos. I have in my home directory Now this is something I do very common if I'm recording If I'm recording a screencast and I make an error or I want to I have a different take that I want to include or something like that I might want to split tracks up I might want to put them together one thing I do very commonly is so this thing here is called with audio So I'm going to open a file actually here's what I'm going to do so we're going to say with audio and Another file that I want is I think this screencasts Right here, so screencast That one okay, so I'm going to output both of those to a file now What I'm going to do is I'm going to combine these okay So ffmpeg can actually take a certain input that looks something like this You can say okay here's a list of files and you can just combine them with the ffmpeg concat command So I can say ffmpeg concat Take that input file. I'm going to say copy all the codecs and then we're we're going to have you know We'll just put it in output Dot mp4 so if I run that it's going to take a minute actually not that Since I'm copying codecs. It's not going to take too long I'm going to wait for okay great already over so now we can look at output Okay, I'm going to get rid of this for a second and this is actually going to meet the combination of that video I put up a second ago and then a minute later It's going to go into that's what I was just recording that was before I synced my my talking up Okay, so that's actually how how I do video editing I just use it ffmpeg as you can see it's very quick to use once you know the commands And if you don't know the command so I can the case of you know that script I had a second ago fix audio. I never can remember some of it. It's easy to put in a script So I recommend looking into to ffmpeg Because I mean as I just sort of told you I'm constantly finding useful stuff in it useful filters to do and Ideally I'd like to even make very complex I don't want to say complex but a little more complicated videos with you know, I know there are other people who use ffmpeg I think I want to say Chris Acapinti does Introductions and stuff like that. He has ffmpeg automatically put them in I'm pretty sure he does that But anyway, check it out. I'm just telling you that ffmpeg is out there. It's very useful I use it all the time. I it's literally my video editor. Anyway, that's about it. I'll see you guys next time