Ok, so I got a bit tired of constantly seeing the "lag preview" topics, it's once every two days and feels pointless always copy pasting the same answer for just the next day somebody else asking the same thing, clearly not looking it up. So here goes a full explanation from beginning to end, hopefully this will clarify and make those spammy topics less common. Disclaimer
: I'm not a professional on the matter and everything that's written here requires you to do your own research for proper information. At certain points, some terms may not be the most technical ones to help less knowledge people to understand it's meaning and there may be inconsistencies with my non native English.
With this said, let's start.
First of all, it's important to understand that a video file consists of a set of images all together that when displayed one after another really fast, they create the sense of motion, or as we call it a "video". In the video editing industry, such images are called frames and the motion we see happening is defined by it's frame rate, also know as fps - frames per second. So, in simple terms, just like Photoshop edits one image, Vegas Pro edits many images, whether at the same time
or manually, with us editing keyframes one by one.
- How is a video quality defined?
Videos contain many properties that will ultimately make it look better or worse in different ways. From video resolution to bitrate, compression method, framerate and color depth, all will play a role on how a video will look like. Video bitrate
Video bitrate is measured in Mbps (Megabits per second or Mb/s) and it's important to distinguish it from MBps (MegaBytes per second or MB/s), as they are used for different purposes. Since 8 bits = 1 byte, it can always be converted but many times ends up creating confusions for their similarities in the name. Usually, internet speeds and video bitrates are in the mb/s form, while everything else works with MB/s (transferring files, for example). But why does this really matter for videos quality? Well, the bitrate is probably the biggest factor when it comes down to video quality, since it defines the amount of data stored in each frame, therefore, providing us with more/less information giving it a sense of a betteworse quality. Video resolution
As the name says, it's the resolution that the video will be at, meaning that every frame will be at that same resolution. Higher resolution alone doesn't mean it's going to look better, in fact, it might be actually the opposite! These days we see a bunch of advertisement on 4k like that's some sort of superior quality (to be fair, in most cases it is), but without the bitrate, resolution alone won't do much. Let's assume we got these 2 videos with a bitrate of 10mbps, but one video has a resolution of 1080p while the other is at 4k. Note that the 1080p resolution is 1920x1080 (meaning it has roughly 2 million pixels) while the 4k resolution is 3840x2160 (roughly 8.3 million pixels), so we can say 4k resolution has 4 times more the pixels that the 1080p presents us, BUT both of these videos are being filled with only 10mbps, meaning that the 1080p will have each of it's frames filled with more data compared to 4k. So if we wanted to compare both of these videos side by side in their original resolution, we would see that the 4k one would be much bigger, but much less fullfilled with information giving us less quality (by presenting artefacts and other low quality visuals). As an example, the 4k video would need to be around 40mbps to provide the same quality preset
as the 1080p video and since the 4k video has a larger resolution, it would be easily perceptible it's quality as superior. Video framerate
Video framerate will provide us with the illusion of movement, whether it's going to be a smooth experience or a stuttering one. If we compare a 10fps video with a 100fps video, we will notice that the 10fps will be jumping/jiggering/stuttering duo to the lack of frames in each second - being just 10 - giving us the perception of a timelapse even! While the 100fps video will look so smooth it's hard to believe we're actually seeing 100 images each second. With this said, the same logic from video resolution also applies when it comes to framerate, as per this example: if we have 2 videos where one is 30fps and the other is 60fps and both are at 10mbps, the 30fps will be the one with better quality, although providing a less smoothly experience. Those same 10mbps will fullfill more the 30 frames in each second in comparison by doing the same to 60 frames where it would be roughly half the quality (not exactly half but to keep things simple, let's assume so). In the end, we can define our framerate depending on our needs, if we want fast, smooth experience, we should aim to a higher framerate but we will lose some quality unless we also set a higher bitrate to compensate for this; if fast, smooth experience is not required, we can save ourselves of such "trouble" and work with a lower framerate. Video codec
This is a very complex subject, so I will try to keep it short and simple. First, we should be aware that codecs are different than formats (those are just containers), for example, if we see a .mp4 format file (just a container), that doesn't tell us which kind of codec it has, it could be a variety of them. In the same way, a specific codec can have different formats. Formats play only a "secondary" role here and codecs are the ones we should take a look into because they define how much compression a video will have - if any compression at all. An uncompressed video will provide the best quality (and a huge bitrate number) at the cost of file size, while high compression codecs will provide a much smaller file size while trying to keep a high quality (not as good as uncompressed). General rule of thumb, the more compression a video has, the more processing power it's required to compress and decompress the video and this can be a very taxing task to the hardware. In the same way, the more compression a video file has, the more quality it's going to lose when it gets re-rendered, so, the more we render a compressed video file, the worse it will look. Video file size
Although this won't define a video's quality (quite the opposite: the video's quality defines the file size), it's good to have a sense how it works. Let's say we got this 10 second video file at 14mbps, at this point we can already do the math to know how big the file size is: 14mbps x 10 seconds / 8 (because 8bits=1byte) = ~17.5MB. Even if we grab the same video (the 14mbps one) and make it in a small resolution such as [email protected]
and also [email protected]
, both will be at around 17MB. So, like mentioned, the biggest quality's and file size factor is the bitrate.
Now that we have a sense of what a video actually is and it's properties, we can focus on Vegas and it's laggy preview. Many people think because their NASA computer with a [email protected]
that can run the latest game at ultimate supreme settings, that Vegas should play the preview smoothly, that's wrong. The processing power required to deal with realtime decoding (in a smooth way) is much higher than the current hardware available to us at the moment. Some may say that they're able to play the video on the media player without stuttering - and that's correct - but a video player only plays videos in a linear way and highly compressed codecs, such as h264 and h265, are able to play forward smoothly (because of the way they were designed), but when we start skipping the video back and forth or skip a bunch of frames, we may notice some lag to the media player shows the current frames smoothly, especially if the hardware isn't the most powerful and/or we're talking about h265 with high bitrates/resolution/framerate. Although the bitrate is the big factor into quality as we saw before, resolution and framerate can also take a big hit in processing power and, of course, when we ally them all, we're talking about a heavy task!
When we talk about a NLE (Non-Linear Editing) such as Vegas, that takes a much bigger toll than a simply media player because it has to uncompress the video file's data in realtime and show us what's going on with it. If we try to edit an uncompressed video in Vegas, we're going to get a smooth preview (unless the hardware is from last century) and also there are a few codecs that aren't so high in compression allowing us to edit lag free. Since the codecs that is most widely used (h264) is a heavy one, that will require a lot of processing and most likely might lag at some point in the timeline, especially when we add certain effects/transitions, it is a very heavy task for the CPU - and to the GPU and RAM to a certain extant.
- How to solve the lag so we can edit?
There are several ways to solve this and I will mention the most common ones, these should fix it for the majority of people. Preview Window Quality
The fastest and simplest method is decreasing the preview window quality
. You got 4 options here and each has 4 more options in them. Focusing on Preview option (for simplicity purposes), you can see in the previous screenshot that it has selected "half" in it, that means it's previewing the timeline at half of the resolution of your project settings. You can see on bottom of the preview window that my project is set at 1920x1080, but the preview is at 960x540. This helps a lot saving processing power from the preview (as we already know that higher resolutions need more processing power) and if that's not enough, we can select Preview - Quarter which, as you can see here
, will make our resolution 4 times smaller than the original (being 480x270 in this case). It works like this for other options except the Draft one, that one uses half of other resolutions, making it able to go one step smaller. The main difference between the 4 main options is the quality provided in realtime: Draft being the worst, Best being the best, of course. Proxies
This option is going to take the biggest impact on the performance of the preview since it will allow us, in most cases, to get completely rid of the lag. Codecs come into play once again but to keep it "easily accessible", we can simply think light to edit codec
(low rate compression one) or a heavy to edit codec
(high rate compression one). If we're trying to edit h264, most likely we will have lag and we could simply convert that video file into another codec making it easy for editing, but that would add more manual work for us. That's when proxies come into play: when creating a proxy, what Vegas does is transcoding that codec into an easy to edit codec which will allow us to work lag free and when the time comes to render the video, the original one is the one that will get used so we will have the best quality possible. To create a proxy, it's as simple as right click on the video in your Project Media tab and select "Create Video Proxy". Note: when using proxies, if you set your preview window to Good or Best (in any of their options), it will switch the proxy file with the original; setting the preview window to Draft or Preview (in any of their options), will switch back to the proxy file. You're free to switch between them for previewing needs. Dynamic RAM Preview
Vegas has a nice option that I don't see in other NLEs: the Dynamic RAM Preview. What it does is allowing you to put a certain amount of your timeline into your RAM memory, allowing you to preview it lag free. This option is best used when using heavy effects/transitions and is good to preview 5-10seconds of our timeline. To use it we need to set a certain amount of RAM into it (doing it in Options -> Preferences -> Video), usually 1/3 or 1/4 of your total RAM is fine and then we just have to select a small portion of our timeline and hit Shift+B (or going into Tools -> Build Dynamic RAM Preview). Be aware that as soon as we make changes on that portion of the timeline (let's say I changed my opacity from 80% to 60%), we need to rebuilt it again and the same happens if we change our Preview Window Quality. Also, keep in mind that having our Preview Quality in the better options and full resolution, will consume more RAM compared to lower quality options and lower resolutions, so this may allow you to preview only as much as 3 seconds, or as much as 3 minutes, it all depends on the amount of RAM available to it and the amount is using for the preview. Pre-Render
This method is similar to the previous one, although much slower. It pre-renders your selected timeline into your harddrive (instead of RAM), allowing you to preview it lag free. I would only recommend this one in the case we don't have enough RAM to preview what we want, because it is basically a mini-rendering option. Still, it's an alternative and to use it, we just select the portion of the timeline we want and press Shift+M (or going into Tools -> Selectively Prerender Video). Other methods
I will only mention slightly some other methods, but I do not recommend doing them unless all previous steps didn't help. Turning off GPU acceleration can get rid of most lag or leaving it turned on while setting Dynamic RAM Preview to 0 (you will lose the Dynamic RAM Preview function by doing so), there's a relation between both since old Vegas versions. Also, not having a low amount of virtual memory (pagefile size) may help with certain crashes/errors - if you never changed it, you don't have to worry - this is intended to people who reduced it duo to having high amounts of physical RAM.
Hopefully this explanation helps somebody and we can reduce the amount of repeated topics. In case you got any question, feel free to ask.