 Okay, we've been working mostly with MLT and Melt in the command line to do some video editing. We have join clips and save them as a file and preview them. Now we're going to work on transitions, just a basic simple fade transition, which is probably your most common transition from clip to clip. So, once again, let's have a look at our directory. We have some videos that we rendered in the last tutorial, all these 100 ones, even in our original MOVs here. These MOVs are off our conversions from my original MOVs off my Canon T3i. We are going to today, as I said, take a clip and fade one to another and then eventually fade them all together. So, we're going to use MLT and then we're going to give it a file name. So, that's our first video there. And then our second video clip. And then we need to tell it, we want after each clip, basically, so each clip you put in, after it you give parameters for that. So, there's no parameters for our first video clip because we just want to play that video. But our second video clip, we want it to fade over the first one. So, it's going to mix both audio and video. So, you're going to get a nice audio fade and video fade. So, for the second video, we want to dash mix it. And we're going to give it the mix length. And this is in frames. My video was taken at 30 frames a second. So, we're going to say 30 because I want a second length of fade. But maybe you want longer or shorter fades. It's up to you. And then dash mixer is going to be the type of mix that you're doing. In this case, we're going to say Luma, which is a basic fade transition. So, we're, once again, using Melt, we're going to take our first video clip, put it into our project, take our second clip and then say, with our second clip, mix it for 30 frames with the clip before it. And then what type of mix we're going to use. Mixer Luma. And we're not giving it any video output, consumer output here. So, it's just going to give us the preview of it. So, go ahead and we'll hit enter. And there it is. You can see fade from one to the next. And then done. We'll hit Q to get out of that. We'll run it again just so you can see. We're going to let one second or 30 frames of transition. So, let's say we wanted to add another video clip to this. So, we got our first two. We'll just take the next video clip, put it in there. We will say we want it to mix for 30 frames of the video before it. And the type of mix we're going to use dash mixer is going to be Luma. We'll hit enter, fade, fade. These are short video clips. So, the second fades on some of them are going to take up pretty much all the video clip because most of these clips are three to five seconds. This is usually what I film them at if I'm not doing a fade effect like this. When I film this, I meant for them just to be connected if you saw that video that I uploaded originally. So, that's great, but let's say we want to connect all these videos and fade each of them 30 frames with the video before it. Well, we can type it all out on the command line or we can go into a script and create a for loop. So, I am going to use Vim as my text editor. As always, use the text editor of your choice. I just like Vim. And I'll just call this fader.sh. We will then say that it's a bash script. So, in our shebang line, we're going to say bin bash. Next, I'm going to set a variable for the length of the fade. This way I can use the script later on and I can quickly change the length of the fades. So, I'll create a variable. I'm going to call it's when for length and I'll say 30 frames. Next, I'm going to create a variable called x and I'm going to leave it blank, but I'm going to create it. Next, I'm going to say for I in all our movie clips, all our MOVs. And then we're going to say do. I'm going to finish my loop with done. And I'm going to say x equals dollar sign x. So, we're taking x, which right now equals nothing and we're making x equal to it because we're in a loop. So, each time we're going to connect new stuff to this loop, to this variable. So, next will be our file name. So, dollar sign I, that's our variable created right here. And we are going to just like on the command line or in the shell, mix. And we'll use our variable for our length. I'm going to say dash mixer, Luma, colon, or not colon, close our print or quotations, which I had actually already done. So, at this point, I'm just going to go outside our loop. And I'm going to say echo dollar sign x, lowercase x and put those in quotations. Just so you can see what's going on so far. We're not done with the script yet, but we're going to save it. I'm going to make it executable. And then I'm going to run it like so. And you can see we now have a variable that's equal to file name, mix, file name, how we want to mix, file name, how we want to mix all the way through. So now we can take that and connect it into Melt and then use eval to run the variable as a command, which I believe I showed you in a previous tutorial. So, let's go back into our script here. And this time instead of echoing it out, once we have that long of all the video clips with the fade mix options in them, we're now going to say x equals, x equals our Melt command. And then we're going to say dash consumer, because we want to save this to a video clip to an output file. Of course, we can leave this part out if we want to just preview it. But I'm going to save it out. We're going to save it to audio video format. And I'm going to give it a name of fade so we know the output is fade. And now just so the script doesn't overwrite a file that already exists, I'm going to give it a little different of a variable here. I'm going to say date plus percent s. If you follow my tutorials, I do this a lot. Basically, that's just going to give it a timestamp. So it's going to say fade timestamp dot and we'll say avi. So every time I run the script, it's not going to override the last file. It's going to create a new file based on the date and time. Next, I'm going to say video codec equals lib and, like I said, I like to use xvid. And I'm going to give it a rate of 5,000k. I'm not going to worry about audio. I'm just going to let do whatever the default audio is. And that creates the variable that is our command. And then I'm going to say eval dollar sign x, which will run our command. It will run our variable, which is now our command. And so now if I typed everything right, and I've already made it executable, I can just say fader enter. We will get one or two errors at the beginning here about invalid position for mix, invalid mixer. The reason I believe for this, once again, I'm kind of new to this whole process with Melt, is we gave mix parameters for our first video clip. Well, the first video clip has nothing to mix with because there's no video before it. So that's why we get that error. Now, you'll also notice, remember, before we did this, our video was 1,413 frames, I think, in the last tutorial. Well, it should be a little bit shorter now. Yeah, 933 frames because our video is shorter because the videos are overlapping. So now if I typed everything right, I should be able to use mPlayer and play our video, which starts with fade. So there's our video file that our script created, fade underscore, and then our timestamp here, that AVI I'll hit enter. And there we go. So it's fading each video clip into the next one, or actually the way we did from the previous one, at 30 frames, which in my case is one second. You probably can't hear it because I disconnected the audio so you can hear me talk. But it's also fading the audio, so you get a smooth audio transition as well. So if you had a whole bunch of clips that you wanted to fade together, this is great. I love Kaden Live. Like I said, I use it for all my video editing stuff. Back in the day, in my Windows day, I had, this is going on eight years now. I used to use Sony Vegas. I also use Adobe Premiere a lot before I switched Linux and started working with open source stuff. Kaden Live, as far as I'm concerned, everything that I had to do that I did in those programs, I can do with Kaden Live. But every once in a while, there are things that there might have been options that made things a little bit simpler. And I'll give an example of one of the reasons I like Sony Vegas over Adobe Premiere, and maybe Adobe Premiere could do it, and I just didn't know how, is I could set that when I drag, here's an example, oh, Kaden Live, I thought I had it open. If I had a bunch of videos, I could drag them to the timeline, but before I drag them, I could have set them to automatically overlap and fade a certain size. Wedding videos, every video clip fades from one to another, you know, and that's what I mainly used it for. One of the problems I've had with Kaden Live is, at least not that I know of, I would usually have to drag all the videos and then move each video to overlap by one second and then click on each one to do the fade. Didn't take long, but longer than need be. So now I have a script that automates that for me. Anytime that I film a wedding, I can just take the clips from a certain piece of that wedding, run the script on them, and my video is done other than maybe adding music and a fade in and fade out at the end, which we will get into both those things in future tutorials. So I hope you found this tutorial useful. I'll bring up the script again so you can look at it. We'll review it one more time here. We got a shebang line saying just telling our operating system this is a bash script. In case you're using a different shell, we want to make sure that the way we're typing things out is run through bash. So it's a bash script. Then we're saying a variable for the length and that's just to make it easier in case you want to change it later on. We're creating our X variable, leaving it blank. Then we are starting our for loop and then for each video clip, we are going to append our mix options too. Then we're going to take that and add our melt command and whatever we want as our video output to it. Then using eval, which once again I've done a tutorial on, which takes our variable and runs it as a command, which gives us our video output. Once again, I'm using the date option here to timestamp the video so that doesn't overwrite a previous video on the same folder when I run the script so you don't accidentally overwrite something you've created every time it should. Every second it creates a new timestamp so unless you run the script twice within one second shouldn't be overriding any videos. So that's it. I'll leave this up on the screen while I talk in case you want to look at it. Filmsbychrist.com, that's Chris Decay, should be a link in the description. I asked that you visit my site. Check it out. Lots of tutorials on there. Video editing, in-video editors, special effects with Blender and Kaden Live. Also plenty, plenty of programming, scripting, free and open source tutorials. So visit my site. There's a help button there. If you need help, click there. Try not to ask technical questions in the YouTube comments because it's not a great place to have those conversations. It's just annoying. Also if you enjoy my tutorials, please visit my site and there is a donate button. Any type of donation, help the site keep going. I appreciate it. Thank you for watching and I hope that you have a great day.