[0:00] So, if you have a huge video file and [0:02] you want to compress it without [0:04] noticeable quality loss, you can do that [0:06] with a single FFmpeg command. And in [0:10] this video, I'll show you how to do that [0:13] perfectly. So, for that, you will have [0:15] to have FFmpeg, a command-line video [0:18] processing tool, installed. I have a [0:20] video on how to install it. It is very [0:22] easy and straightforward. The link is in [0:25] the description. So, once you have [0:26] FFmpeg installed, you can just reduce [0:29] the size of your video without [0:31] noticeable quality loss in a single [0:33] command. So, here is a video I have. It [0:36] is 7 minutes long, and the size is 6. 23 [0:41] GB. So, let's open the command prompt in [0:45] this directory so that I can execute [0:47] command on this file. And let's type [0:50] Let's see the details of this video. [0:54] So, as you can see, it is using AVC, [0:57] means Advanced Audio Codec. This is a 4K [1:00] video, 60 FPS, and a audio with AAC [1:04] codec. [1:06] Bit rate is around 320 [1:09] kbps. So, I have prepared few command, [1:12] and those commands come in handy based [1:16] on your [1:18] situation. Like if you have an Nvidia [1:20] GPU then [1:22] you'll use Nvidia encoder, which will be [1:26] super fast. But if you do not have it, [1:28] don't worry. You will use processor [1:30] source [1:31] uh coding power, and that is sometimes [1:34] way better. Just a bit slow, but [1:37] compression is way better than Nvidia. [1:39] So, the first command is for regular for [1:43] everyone. So, here as you can see, we [1:45] are using lib [1:48] uh 264 [1:49] codec. So, whatever your video file is, [1:53] the output video will have a lib x264 [1:57] codec, which is very mainstream codec. [2:00] And then it comes There comes a flag [2:03] called CRF. So, here in CRF, the higher [2:07] value means [2:09] lower quality. I mean, more compression. [2:13] So, if the value is 18, then you'll see [2:16] no difference. But if the value is 28, [2:19] then video quality may degrade a little, [2:22] but the size will be reduced a lot. So, [2:26] a safe point is 23. Then preset medium [2:30] for a balanced encoding, and I'm [2:33] copying the audio codec, not changing or [2:36] anything related to audio. And the [2:38] second command is if you want to have [2:41] very small file size. And again, if you [2:45] have Nvidia GPU, then you'll use H.264 [2:49] NVENC. Same encoding algorithm, but done [2:53] with the GPU for faster encoding. But [2:57] uh the CRF flag changed to CQ for [3:00] Nvidia. [3:01] Everything else is same. 23 for a medium [3:06] compression, and preset before is also [3:09] for medium. [3:10] So, the value before and CQ [3:13] changed for Nvidia encoding, and I did [3:17] not [3:19] change the audio encoding here still. [3:22] But if you want to have more control and [3:25] a resilient command, then you can use uh [3:28] something like {hyphen} a, means AC. [3:32] That means audio will be changed to AAC, [3:36] and the audio bit rate will be 120 kbps, [3:38] which is like standard. And you'll use [3:42] some additional uh flag like pixel [3:45] format you've 26 uh 240 pixel, and some [3:51] checking like if there is an audio If [3:54] audio exists, then do the audio [3:56] processing. If not, then don't. So, [3:58] those are uh commands you can use to uh [4:03] reduce the file size without losing [4:06] quality drastically. So, I'll go with [4:08] the last command since I have an Nvidia [4:12] GPU. So, by the way, uh the input file [4:16] is here, for example, input.mp4. So, you [4:19] can replace this with your file name and [4:22] extension. [4:23] And whatever you put at the last as file [4:27] name will be name of your output video. [4:31] So, my output video will be [4:33] output_compressed.mp4. [4:35] You will see if everything goes [4:38] correctly. So, I'm copying this command. [4:40] The name of my input video is input.mp4. [4:43] Let's go to the directory. Let's rename [4:45] it to input.mp4. [4:48] And let's open the command prompt in [4:51] this directory. And let's [4:54] zoom in so that you can see the command [4:56] and paste the command. [4:58] So, currently, the video is being [5:01] processed. [5:03] As you can see, [5:06] it is [5:07] using my GPU. So, yeah, video processing [5:11] is resource-heavy. [5:14] If I [5:16] would use the [5:18] processor encoding, then it would take [5:21] even more [5:23] even more time to [5:25] encode the video. [5:28] So, let's wait for it to complete. [5:32] The video compression is processed. [5:34] Now, let's go to the directory [5:38] and see what is the output video look [5:40] like. The input video is around 6.23 GB. [5:46] And the output video is 1.63 [5:49] GB. So, from 6 GB to [5:54] uh 1.5 GB, [5:56] 75%. [5:58] Okay. [6:00] So, 4:1 means from So, initially, if the [6:05] video size was 6.23, now the video size [6:08] is 1.63 with identical video quality. [6:13] So, that is how you can easily reduce [6:16] your video file size. And here I have [6:19] used some additional flag like MOV flags [6:22] plus faststart. So, if you stream or [6:25] play the video, it will start super [6:27] fast, which is very convenient. So, [6:30] that's it, guys. Uh if you have any [6:32] questions or any comment, feel free to [6:36] put that in the comment section below. [6:37] I'll be happy to reply and see your [6:40] opinion. So, that's it for this video. I [6:44] will add this to the comments in the [6:45] description and also how to install [6:47] FFmpeg. So, that's it for this video. [6:50] Hope you have learned something. See you [6:52] in the next video.