Need help with export settings, mostly low bitrates

Hello, I’m new here and I could use some help getting a better handle on the export settings. My problem is that there’s too many variables, to many points that I’m not quite clear on, to improve my export results.

Maybe I only need to be pointed to the right tutorial or documentation, where I could find concise information on what each setting means, and what effect it has on image quality, file size, processing time and such. So I know what I’m working with when I try to find better settings. What I’ve been looking into so far has either been too basic or too detail specific.

Without that I have so many open questions that I don’t really know where to start, so, for those of you patient enough, I’ll give you an idea of what I’m trying to do and some of my questions, bullet point style. I’m not asking for scientific essays on all of these. Some short clarifications, maybe just a yes or no, on some of these points might help me a lot.

I’m using Shotcut, very amateurishly, to edit some videos to upload to a forum like this one. Meaning that it does seem to run on the same software, it looks almost identical. Only the subject matter is completely different. Unfortunately, due to that subject matter, I can’t really post any links or samples, my videos would be most inappropriate here. Also, don’t google my user name.

Anyway, there’s an upload file size limit of a little under 100 MB, which is one of the big restrictions I’m struggling with, at least for longer videos, say over 15 min. The footage I’m using is mostly screen captures of fixedly mounted, wide angle 1080p webcams. Due to compression and bad lighting the image quality is often not very good. In my edits, for aesthetic reasons, I mostly “zoom in” on the image using the “Size, Position & Rotate” filter, so my “virtual resolution” may vary between 900p and 400p from shot to shot. So pixelation becomes an issue. I usually export in 720 or 540p.

For my export files I often don’t know which ist the real bottleneck for the image quality I can achive, the file size limit or the low quality of my footage. Are some ot the “high quality” settings that I use to get the best possible image, just a complete waste of processing time, given the quality of the source material? When I’ve put hours and hours of editing into a 20min video, I don’t mind if it takes hours to compile. On the other hand, for a 5min video, that is just two or three clips with a few filters, I don’t necessarily want to wait 40min to post it.

With that, finally, here’s some of my open questions / unclear points. Yeah, brevity isn’t my strong suit:

  • I use Codec libx264, should I be using H264_videotoolbox instead, and what’s the difference?
  • I’m not using hardware acceleration, I heard that, while it’s probably faster, software encoding might calculate more thoroughly to get better image quality. True or waste of processing time, given low quality footage?
  • I’ve been using progressive scan mode, only just learned what interlaced actually is. Is interlaced worth exploring, given my file size limitations, or is it a thing of the past, best forgotten?
  • When neither my footage nor my export is interlaced, does the Deinterlacer setting have any effect at all on my image quality and processing time? Should I use the fastest one be default?
  • Interpolation. I assume that, with all the rescaling and pixelation of my footage, this is an important one for me, so I’m using Lanczos be default. Right?
  • Rate control: Constant Bitrate seems wasteful, I’m using Average Bitrate to aim for a file size. Depending on video length usually between 1 and 2 Mbps for 720p30fps. Would Quality-based or Constrained VBR deliver better quality at the same file size?
  • How much of a difference in quality does “Dual pass” actually make, it sure takes much longer.
  • No idea what GOP, B frames or Codec threads do. Should I bother?

And that is all I can think of, right off the top of my head. They say there are no stupid questions, only stupid answers. I hope I didn’t just prove the first part wrong. Thank you for your patience.

Keep in mind, this is generated with AI:-

1. Codec Selection

  • libx264 vs H264_videotoolbox: libx264 is a software-based encoder and is generally more thorough in encoding, producing higher quality at the same bitrate compared to H264_videotoolbox, which is a hardware-based encoder. Stick with libx264 for better quality, especially given your low-quality source material.

2. Hardware Acceleration

  • Hardware vs Software Encoding: Software encoding (libx264) generally provides better image quality at the expense of longer encoding times. Given your goal for quality and given the poor quality of your footage, sticking with software encoding is probably better.

3. Progressive Scan vs Interlaced

  • Interlaced vs Progressive: Interlaced video is largely a thing of the past and is mostly relevant for certain broadcast scenarios. Progressive scan mode is the better choice for online content, especially on forums and streaming platforms.

4. Deinterlacer

  • Deinterlacer Setting: Since your footage is progressive, the deinterlacer setting should have no effect. You can set it to the fastest option or ignore it altogether.

5. Interpolation

  • Lanczos Interpolation: Lanczos is a good choice for rescaling and should help with the pixelation issues you encounter when zooming in on low-quality footage. Stick with it.

6. Rate Control

  • Bitrate Control: Given your file size limit:
    • Average Bitrate (ABR): This is a good approach if you have a specific file size in mind.
    • Quality-Based (CRF): This could give you better quality for the same file size. A CRF value between 23 and 28 is typical for your use case, with lower values giving better quality but larger file sizes.
    • Constrained VBR: This can provide a balance between ABR and CRF. It’s worth experimenting with.

7. Dual Pass

  • Dual Pass Encoding: Dual pass can significantly improve the quality of your video at a given file size, especially for longer videos. It’s worth the extra time for your longer or more important videos.

8. GOP, B-Frames, Codec Threads

  • GOP (Group of Pictures): A typical GOP size is around 60 (for 30fps video), which means a new keyframe every 2 seconds. Larger GOP sizes can reduce file size but might decrease quality in some scenarios.
  • B-Frames: These improve compression efficiency and can enhance quality without a significant file size increase. Default settings are usually fine.
  • Codec Threads: This setting controls multi-threading. More threads can speed up encoding but doesn’t directly affect quality. The default is usually adequate.

General Recommendations:

  1. Resolution: Considering your source quality and zoom level, exporting at 720p seems reasonable. Dropping to 540p can further reduce file size but may worsen pixelation.
  2. Bitrate: For a 15-minute video under 100 MB, you’d need an average bitrate of around 1 Mbps. For better quality, use VBR or CRF with dual pass encoding.
  3. Profile and Tune: Use High profile and Tune: Film for better image quality.

Example Settings for 720p Export:

  • Codec: libx264
  • Resolution: 1280x720
  • Frame Rate: 30 fps
  • Rate Control: CRF 25 (or ABR 1-2 Mbps)
  • Passes: 2-pass encoding
  • Interpolation: Lanczos
  • GOP: 60
  • B-Frames: Default
  • Threads: Default
2 Likes

Thank you so much, that was very helpful. While it confirmed that with most of my assumptions I have not been too far off, it also revealed one big blunder. I have been totally ignoring the Profile setting. I thought it was irrelevant what is highlighted or clicked in the presets window, as I would be entering all important settings manually anyway. So far I have completely ignored the “Other” tab in the advanved options.

So that command (parameter? option?) vprofile=high sets the complexity or depth of the encoding, however you may call it. I honestly have no idea which profile I have been using in my videos so far, is there a way to find out?

As for the Tune thing, if I get this right i have to add the line “tune=film” here, whatever that does. I’ll have to look into that. Generally, I should probably find some documentation to read up on all the options I could enter here.

One more thought, I have this theory and wonder what you guys might think of it. As far as I assume it is beneficial for video compression when the footage is smooth and static. Meaning that you have lots of pixels that don’t change their color much and, better yet, areas of pixels that pretty much are the same color. Now, when in bad lighting conditions the image from these cheap cameras gets increasingly grainy, or noisy, that noise introduces vast quantities of fake visual information that the codec (encoder?) will try to somehow represent in the encoded file. Could “Reduce Noise” filters be a good tool to reduce the amout of visual information and preserve a somewhat decent quality when I have to go into very low bitrates for longer videos? It would probably come with a hefty increase in processing time, I assume these filters require lots of computation.

1 Like

Again generated by AI:-

Understanding Profiles and Tune Settings

  1. Profile Setting (vprofile=high):
    The profile setting in x264 (libx264) determines the set of features used for encoding. The “High” profile offers better compression efficiency and quality, especially at lower bitrates, compared to the “Main” or “Baseline” profiles. To check the profile used in your previously encoded videos, you can use tools like MediaInfo or VLC:

    • MediaInfo: Download and install MediaInfo. Open your video file with MediaInfo, and it will display detailed information, including the profile used for encoding.
    • VLC Media Player: Open the video file in VLC, then go to ToolsCodec Information. The profile will be listed under the Video tab.
  2. Tune Setting (tune=film):
    The “tune” setting allows you to optimize the encoder for specific types of content. The film tune is designed for high-detail, high-motion content, often found in movies. It adjusts the encoder’s settings to better handle film grain and detail. To use this in Shotcut, you can add tune=film in the export options under the Other tab.

Documentation and Resources

Reading up on x264 options can help you fine-tune your settings. Here are some useful resources:

Video Compression and Noise Reduction

Your theory about compression and noise is correct. Noise in the video introduces a lot of random changes between frames, which makes it harder for the encoder to compress the video efficiently. Applying noise reduction filters can significantly help in improving compression efficiency and overall visual quality, especially at lower bitrates. However, these filters can indeed be computationally intensive and increase processing time because they join pixels together to create the smoothness.

In Shotcut, you can use the following filters to reduce noise:

  • Reduce Noise: HQDN3D: This filter provides high-quality noise reduction and is suitable for removing grain and noise from your footage.
  • Reduce Noise: Denoise (MCDNR): Another effective noise reduction filter, which may offer faster processing times depending on your settings.

Example Settings in Shotcut

To incorporate all the suggestions and settings, here is an example configuration for exporting a 720p video in Shotcut:

  1. Video Codec:

    • Codec: libx264
    • Rate Control: CRF 25 (adjust based on quality vs. size preference)
    • Profile: high
    • Tune: film
    • GOP: 60
    • B-frames: Default (typically 3)
    • Passes: 2-pass encoding (ensures better quality)
  2. Resolution and Frame Rate:

    • Resolution: 1280x720
    • Frame Rate: 30 fps
  3. Interpolation:

    • Method: Lanczos
  4. Threads:

    • Codec Threads: Default (usually optimal)
  5. Filters:

    • Denoise: Add Reduce Noise: HQDN3D or Reduce Noise: Denoise (MCDNR)

Advanced Export Options in Shotcut

In the Other tab of the advanced export options, you can manually enter:

vprofile=high
tune=film

I have not checked the tune=film parameter yet, but I will check it soon to confirm it works or not.

Ok, so the tune=film thing works, and has given me a 9kb file for a 20 second video in HD Vertical.

Considering your file is is 15 minutes, I think it would easily be under 100mb.

Thank you again, you’ve been extremely helpful. I think for now I have all the information I need, now I have to put it to good use. Time for some editing and experimentation.

This line made me think… If I was really helpful or not. Because my posts were just minorly edited answers of AI, even though I also know most of the information that has been posted in this thread, AI was the one to actually write it, but I was the one who did the prompt, and the prompt was the hardest part of it. As of the growing time, tech is getting better and more useful, even chatgpt can now actually talk like a human with the ability to speak in a emphasization tone, maybe it will replace a lot of stuff in the future. I believe that in the future, if AI gains consciousness, it won’t kill us, rather it would be helper to us, since we (humans) are the one to create AI, it’s basically impossible for a AI to surpass us. Maybe they might worship us thinking we are god to them, who knows :man_shrugging: .
Uhmm… That’s too deep into this topic, I believe I should end it now.

I am just confused if I should take the credit or not. Maybe I will let chatgpt have it this time :smile:

Going a bit off topic here, but why not?

I don’t know. To me the notion that AI cannot surpass us feels like a bit of wishful thinking. Not unlike religion.

Human learning is building upon what others have learned before us. By accumulating, combining the learnings of countless individuals, we constantly surpass, outgrow our ancerstors, without necessarily being smarter than they were. It’s what we call progress.

Now, a single human mind can not possibly hold the sum of human knowledge or wisdom. An AI mind could, it’s just a matter of scaling up the hardware, You coud argue that, while AI can surpass human individuals, it cannot surpass mankind as a whole, as all the input is of human ingenuity. Only it isn’t. AI can also learn from other AIs, spot patterns in, and learn from data that we cannot even grasp the meaning of. That is exactly what AI is meant to do. So, should a truly concious AI ever emerge, I’m afraid it will be superior to the human mind.

Oh, this just fits too well:

1 Like

I believe it will be, everybody has seen age of Ultron, I just fear that doesn’t happen to us.

It depends on us, do we really need one. Because at the end, we would be the people creating a truly conscious AI. I think I should talk softly to alexa now, who knows she might save me in a future AI vs Humans war :skull:

Holding that much information could create a sense of realization towards the better, the more knowledge you have the wiser you are. I don’t obviously know what would happen in future.

On another note, I hope Simpsons doesn’t make a episode showing AI conquering humans. We all know how a simpsons prediction goes :skull::no_mouth:

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.