 First off, an apology because this tutorial is mostly going to be me talking because this series needs an introduction and explanation. But we will do a little bit of command line work here to video editing today. And basically, the reason I want to talk a little bit is because a lot of people will be like, why would you want to edit video from the command line? Well, I've got two good reasons. Now, if you plan on making a movie, no, you probably don't want to be doing too much editing from the command line. You're going to want to use a program similar to like Caidon Live. That's what I've been using for the last year and a half, two years for pretty much all my video editing, besides a little bit of blender here and there. And it's great. If you've used Caidon Live in the past and you didn't like it because it crashed or something like that and ran like crap, yeah, a year and a half, two years ago, it wasn't that great. And in the last year and a half, two years, it has come a long way. And it does everything I need pretty much, and what it does in blender does. So I'd recommend checking that out. And if you're going to be doing video editing as far as a movie, that's a great. And if you're not command line person or shell person, this is a great program. But two reasons that you may want to edit or at least know how to edit video from the command line is one, automation is, even when you're doing video editing, lots of times videos are very repetitive when you're doing different projects. Example when I'm doing home videos or even wedding videos. I used to do weddings. I still do them here and there. And they're all pretty much the same. I have a digital camera. I use a Canon T3i right now. I film my video clips. I don't film more than I want if there's a clip I take that I know I don't like. I try to delete it right off the camera right away. That way, when I get home, I can drag and drop the videos into my editor if I'm using something like Kaden Live. And I don't have to go through and delete them then. I can drag them to the timeline. They're usually in the order that they should be in. It's not like a movie movie where you may film things out of order. Home videos and weddings, the order you film it in is pretty much the order it should be in. So automation is something you can do from the command line and you may save you some time. If you're going to drag and drop all the videos clips to the timeline, add fade effects, maybe adjust the brightness and contrast, maybe adjust the speed because wedding videos I like doing stuff in slow motion, I can put all that in the script before I go and film it. Get home, go into that folder, run the script. It will take each video clip, fade them out at one second, maybe adjust the colors, maybe add a vignette and save it to a file. I'm done. All I had to do was type the one command. So also another reason, I forgot it's number two reason that you may want to learn how to work this is you may want to create a program like Kaden Live. Maybe you don't like the way Kaden Live is set up and you're gung-ho enough to go and make your own. Well, Kaden Live uses a back end of a program called MLT. It's a framework for video editing. Kaden Live isn't the only video editor that uses it. OpenShot uses it and if you go to the MLT website there's a list of probably ten video editors that use MLT as a back end. We're going to be using MLT but we're going to be using also a program called Melt to go along with MLT which is kind of a shell front end for MLT. I've done tutorials in the past on doing basic cutting of videos, resizing of videos, using FFMPEG and we're going to be using some FFMPEG in this series and in fact in this tutorial today we're going to be using FFMPEG. And that's great. FFMPEG can do a lot of stuff when it comes to resizing, cropping, trimming the video, converting the video which is what we're going to be doing today. Not that great for effects which MLT will let us do. So MLT will let us see the video live before we save it to a file. So here's an example, I'm in Kaden Live here, let me try to add a vignette effect to all these videos here and smooth it out to about there. So let's say, you know, I was able to do a vignette effect with, oh I only edited that for that one, but anyway, a vignette effect in FFMPEG, FFMPEG or M-encoder however you say it, whatever you do to it you have to save to a file as far as I know before you can view it. So kind of like in Kaden Live here I can scrub through this and see the video live without having to save anything and MLT will let us do that from the command line too from the shell. So basically we can write our script to show us what the video is going to look like before we save it to a file. Because it looks good, click OK, type Y, yes, whatever, and it will save it to a file, which is great because there's nothing like spending 20, 30 minutes or an hour rendering out a video just to find that it doesn't look right. So basically we're going to use Melt here, here's an example, I'm going to hit list, we've got a number of videos in here, these are the original video files off of my Canon T3i, they're MOV files, they're high definition, 1080p, 30 frames a second and to play them all together as if they were joined, which I know you can join files with FFMPEG and M-encode, but as I said MLT will let you preview them all joined before you actually join them in a file. So I'm going to use Melt and all I'm going to do is say melt and give it a list of the files, in this case I'm just going to do all of them, and it will start playing it. So here's a clip with my family a few months ago before my daughter was born to have an ultrasound for people to see whether it was a boy or a girl, and so this is what they looked like during that, and now you'll notice at the beginning of each little clip there it really looked crazy for a third of a second, maybe 10 frames, maybe 5 frames, but it was definitely noticeable, and that's something I wanted to point out, because I'm currently running Debian Unstable, I'm running Debian CID, so the software that I'm using is not stable, so MLT and KDY are not necessarily stable versions, in previous versions what I was going to expect was an older version of KDY and MLT, I did not have this issue. When I went to the unstable, I started having that issue, that's part of the problem of working with unstable software, you get the newest but it's unstable, so hopefully if you guys are working with something like Linux Mint or Ubuntu, you're not going to have that issue or a stable version of Debian, not a big deal, because there's a simple solution for it. That little pause only happens with certain video compression, certain video format and codecs. In Kden Live what I've been doing, we go to file, transcode clips, I'll grab a bunch of clips here, and you have these profiles preset, I'm going to do 1080p, 30 frames a second, 220 megabits per second, this will transcode them to another MOV format that MLT loves, has no problem with them, it's a great format, I don't know if any video loss doesn't take long to convert them, it uses FFMpeg to convert them, so it's an extra step but it solves the problem, also even if you're not having that pausing problem, it might be good to convert to this because it might cause MLT to not lag at all, because MLT just works with it better, a little bit less stress on your computer, so if you're having any type of issues like that, try converting them, and that's what we're going to do today, you could use Kden Live just like this but hey, it's using FFMpeg and it tells you exactly what you need right here, so we'll copy that, we'll go back to the command line and what I could do is FFMpeg and then I can say dash I and then the input file will say, we'll do that one, right there, and then I can paste in what I had from Kden Live and give it a new output of new video or new dot MOV, sorry my, I was overriding the text there, and that will create a new file that MLT works great with, obviously I have a number of files so what we're going to do today is we're going to write a script that will automate all that, put the new ones in the file for editing, this is pretty much what I do, I stick the SD card from my Canon camera into my computer, I run this script, it basically, or a similar version of the script that takes the files that I had recorded that day, puts them onto my hard drive but converts them as it's moving them to this format, so real quick I'm going to create a file here, I'm going to use Vim as my text editor and I'm just going to call this MLTconvert.sh, going to make it a bash file so I'm going to say bin bash on my shebang line here, let's make a folder to put all the converted video into, so make directory, we'll call the folder edit, because it will be the videos we're editing, then we're just going to do a for loop, so we're going to say for i in all the MOV files in this folder, and I'm going to do this so I don't forget, and then we're going to say ffmpeg-i, and then our variable for our input file, we will paste in the command from kdenlive, and there were other options in there but this is the one that I normally use, and then I'm going to save the new converted video to the edit folder and give it the same name as the original file. Now in this case, we're converting to an MOV and from an MOV, so that's fine if you're converting from like an AVI file, just put .mov in here to make sure it converts it to an MOV file. Also as you can see my video is 1080p and the frame rate is 30 frames a second, if your original video is only VGA quality, wherever change the resolution, so you're not making big files because you're not going to up the quality, keep the quality the same, save yourself some disk space. But now that I have that done, I'm going to save that, make our script executable with changemod plus x and that file, and then we will run that file with .mlt-convert and it will automatically start converting all those videos and putting them into that folder. So in the next tutorial, I'll show you the output of that, we'll start linking videos together, I'll show you how not to just preview but save videos and we'll go from there. Hopefully you're finding this useful. A lot of people may not care about doing this and I know that, but it's something I do regularly with a lot of my videos and it saves me time, so I thought I'd share it. It's also good, another reason, well I'll go, I don't want to talk too much in this tutorial. Please visit my website filmsrightcris.com, that's Chris of the K, there's a link in the description of this video. If you're not interested in video editing I have got plenty of tutorials up, watch those while we're going through the series, by the time you're done watching all those, maybe we'll be on to a different topic. Also while you're at my site, if you like my videos, there is a donate button and I just want to thank everyone who has donated and anyone who will donate, I do appreciate it, helps the site keep going. And I just want to say I hope that you have a great day.