Can someone please assist with High Quality settings and low file sizes upon export?

I have 0 video editing experience. I imported a video and used shotcut to trim it. Now I am ready to export. My first attempt was crazy, because I picked the best of everything and got a 50 GB size which is double the original file size even though I made the video shorter.

My second attempt I followed some guides I found here and played around with the codec section, The results were actually OK. I had a MUCH smaller file, about 700K, but the quality was noticeable worse. The video was still watchable, not awful, but was way less smooth and a tad fuzzy.

I’d like to hit the sweet spot and get a decent file size (no more than 3 GB), and maintain the high quality I imported.

  • On the VIDEO tab I matched the resolution and frames with my source. I have read a few posts here, some say to check the box that says “parallel processing”, others don’t mention it. Do i check it or not?

  • the Audio tab I understand

  • the CODEC tab is ridiculously confusing and seems to have the most impact on the file size AND quality. Do I select libx264? What do I set “quality” to there? What should the “crf” read? What do I put for GOP? What do I put for B frames?

Please help me. I’ve spent about 2 days trying different settings rendering this 2 hours movie over and over and just getting bad results.

Why not just try one of the stock presets like the Default, H.264 High Profile or HEVC preset?

Hi, I have tried to stock presets and the file sizes are huge. I am trying to get a manageable file size. Like if I wanted to quickly the movie on a flashdrive and pull it on or off of a computer I could. But I’d like to do so with watchable quality.

How big is your original file? 25 GB?

approximately yes.

Why is it so big? Is it a lossless file?

I believe so, it is very high quality. I used some suggested settings I found somewhere on here and set codec to 1M, and that gave me the very small file size of 700K. I would like to bump up the quality to make it crisper but I am not sure how to scale that. I tried increasing form 1M to the default 12M and the file became unmanageable. Like I said I have 0 editing experience, I was just looking for a tool to trim the file and export it with decent quality. The VBR and GOP and B frames etc, mean 0 to me and I would just like a recommendation if at all possible.

This is the info on the original
image

This is the 700K file
image

What is the happy medium?

Is this a file from like a blu-ray or something?

Have you read this post: Set "Default" export options to the highest quality? It has a lot of useful information about what you are asking.

That thread was about someone asking about the highest quality possible which is different than here. @TriniDiddy here is asking about having the smallest sized file that would still be decent quality. For that, HEVC is the key codec but I was asking about exactly what kind of file he was working with in order to see how far down in size he can go.

Since file size is more important than quality in this scenario, math can provide the answer.

The edited video is 1h 30m 40s in duration, which is 5,440 seconds.

The max desired file size is 3 GB, which is 3 GB * 1000 MB * 1000 KB * 1000 B * 8 bits = 24,000,000,000 bits.

Divide bits by seconds to get data rate: 24,000,000,000 / 5,440 = 4,411,764 bits per second.
Divide that by 1,000,000 to get megabits per second, and round a little for convenience.
Total bit rate = 4.4Mbps

Audio bit rate needs to be subtracted from the total to figure out what’s left for video. The audio bit rate is 176kbps (~0.2Mbps), so that leaves 4.2Mbps for video. If the 3GB cap is a hard cutoff requirement, then round down to 4Mbps to provide a buffer for overages during encoding.

Now for the settings on the Codec tab:

  • Codec: As @DRM said, HEVC (called libx265 in the Codec dropdown box) will produce a file that is about twice the quality of libx264 when constrained to the same bitrate, but libx265 will take six times longer to encode the file. Choose whichever codec fits your workflow best.
  • Rate control: Average bitrate
  • Bitrate: 4M
  • GOP: 180 (60fps * 3)
  • B frames: 8
  • Codec threads: 0
  • Dual pass: It can help some (not night-and-day), but it nearly doubles the export time
  • On the export panel’s “Other” tab, look for a preset line. It may be set to fast or medium. Change the line to say preset=veryfast for libx264 or preset=slow for libx265.

And most critically, do not use hardware encoding. As for parallel processing, it’s usually okay to leave on. Turn it off if unexplainable problems happen in the export, like artefacts or filters that look good in preview but not when exported.

This will be the best that can be done in 4Mbps (to fit within the 3GB cap). If it doesn’t look acceptable, then the resolution will need to be lowered, or the cap will need to be raised.

EDIT: Added recommendation for the preset option

1 Like

Thank you @Austin for this calcul, it will help me.
For GOP, if my vidéo is 30fps, I have to set 90, OK.
But for B frames ? what is the rule ?

There are a lot of variables involved, so rules are difficult to define. :slight_smile:

When a media player is playing a video and the user jumps forward or back on the scrub bar, the media player is going to restart at the beginning of a group of pictures (GOP). So, a five-second GOP is pretty ideal. Longer GOP translates to smaller file size (better compression). In your case, 5 sec * 30 fps = 150 GOP. For the video described in this thread, 5 sec * 60 fps = 300 GOP, but the H.264 specification has a hard limit of 250 GOP. And, going above 200 gets relatively diminishing returns anyway. So I trimmed it to 3 seconds multiplied by 60 FPS for a 180 GOP.

B-frames depend on several things. If the file will be viewed on a hardware player like DVD or Blu-ray or a digital signage box, then their limit is usually 3 B-frames. Software players can go up to the specification maximum of 16 B-frames. However, it is computationally expensive (slow) for the encoder to estimate savings out to 16 B-frames, and the file size savings even if 16 get used are extremely minimal compared to 8 B-frames. So, that makes 8 B-frames the sweet spot for software players when file size is a concern. As in, when trying to get the file as absolutely small as possible, or when trying to squeak the highest quality out of a fixed file size or bitrate. If the file size constraint isn’t there, then it is usually better to stick with 3 B-frames for compatibility reasons, and to prevent the potential of short-term quality strobing between a string of higher-quality B-frames and lower-quality P-frames.

If the export target is HTTP Live Streaming to cell phones, then the restrictions get even more interesting, such as a GOP that is no longer than two seconds. See Apple’s requirements document to get an idea of what would change in that scenario:

https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices

This is Happening because your Bitrate is Extremely high for 1080p Video (about 41.5 Mbps). Some Cameras do that.
I would suggest you use the settings which Youtube recommends. Which is 8MBPS for 1080p or 6 MBPS for 720p.

Set codec settings to Constant Bitrate. The VBR/ 55% Thingy is Confusing.

Forgot to ask, Do you have Graphics card? If so which?