Hey! there all
I'm a newbie to this forum. I would really appreciate if some of you folks help me out in suggesting me with the best H264 compression setting for movie footage. I'm not into hard compression the affects the quality of the output video. I would prefer a normal compression setting that which doesn't affect the quality of the video. My movies are in Uncompressed AVI format. I'm using MEGUI. Is it any good?
+ Reply to Thread
Results 1 to 24 of 24
There's really no magic setting. The rule of thumb is to pick a quality you're happy with, an appropriate tuning (ie tune film) and use the slowest speed preset you can stand. Hardware player support for High Profile, Level 4.1 is pretty much the norm these days. The CRF value used to set the quality is called "targeting quality" or "constant quality" in MeGUI's x264 encoder configuration, depending on whether you have "show advanced settings" checked or not. I don't know why it has two names, but they do the same thing. They both set the CRF value.
CRF18 is roughly where the x264 encoder is considered to be "transparent" but some people are happy with higher values (lower quality and smaller file sizes) while others prefer even lower CRF values (higher quality and larger file sizes). I doubt too many people go below CRF16 though. You'd just need to decide what you're happy with. Generally you can get away with higher CRF values for higher resolutions. I mostly use CRF18 for 720p or lower and CRF20 for 1080p, but that's just me.
I use MeGUI myself, but most free GUI's encode with the same x264 encoder. If you use CRF encoding the file sizes will vary quite a bit from encode to encode. It depends how hard the video is to compress. The quality will be consistent though.
Thanks for the reply.
I'll give it a shot!
Btw, what tune setting must I keep for sports?
The "tune film" option tends to retain a fraction more fine detail than "tuning none", but when you're using high quality CRF values the tunings don't necessarily make much of a visual difference, if any at all. I use "tune film" for just about everything. If something is really grainy I'd be more likely to use a noise removal filter in the script and tune film than I would be to use tune grain without noise removal.
If a sports broadcast is full of compression artefacts and not a lot of fine detail, the effect of "tune film" over "tune none" might be to re-encode the compression artefacts more accurately, so "tune none" might look better. It depends on the source, but as I said, at decent CRF values the visual difference between tunings tends to be quite small.
In my opinion, there's really no free lunch. Any setting change that increases the quality in some way will very likely increase the bitrate, just as increasing the quality will (using a lower CRF value).
It's probably possible to tweak settings that effect how a particular video is encoded.... keeping more detail in flat background areas compared to foreground objects or similar such things.... but that's the sort of tweaking you'd probably have to do on a per video basis, and probably more effective if you're not wanting to change the bitrate at all (ie when using 2 pass encoding at a fixed bitrate and you want to try to tweak the quality a little without the file size changing).
Is your sports video interlaced? It tends to be, and if it is, when you open the video in MeGUI's script creator and enable de-interlacing, it defaults to "Yadif" as the de-interlacing method. That de-interlaces to "normal" frame rate. 25fps progressive for PAL or 29.970 progressive for NTSC. If you use "Yadif with Bob" as the de-interlacing method instead, it'll de-interlace to 50fps or 59.940fps, and motion will look much smoother. For 1080i I'd use "Yadif with Bob" de-interlacing and resize to 720p. If your sports video isn't interlaced, you can ignore all of that.
Last edited by hello_hello; 5th May 2016 at 09:50.
Someone should thank this Bob fellow for working with this Yadif fellow to get things so smooth!
I pretty much moved on from trying to decide a bitrate, long, long ago, and many other settings, etc. I just use CRF, and couldn't be happier - and I don't care what the file size results in. I just accept it given that I'm using quality based encoding. Sometimes it's a bit big in bitrate, but I understand that it was a high complexity clip, but many times the file size is very small too, and I know I saved bitrate.
Quality based encoding is based on physics, very much like signal processing, and is one of the few things that has changed my life for the better in this hobby/field, and even career.
Some points were well covered by H/H, but let me input too.
-I also - almost always - encode with quality based, and almost always go with crf=18.
-I personally encode with x264 straight from the command line these days with ready-to-go batch files. But, if you want a GUI, I'd say HandBrake for simplicity, and MeGUI for the more advanced. Both excellent.
-I always use the film tune for everything. I stopped testing this long ago since no other seems to do better IMO with another tuning. Even with interlaced sporting events.
-These days, especially since processors got so much faster, I always deinterlace with QTGMC(). Also, I double the frame rate (if 29.97/25.0 fps) for smooth motion and better quality. Yes, QTGMC() is slower than all, but very thorough and effective for high quality. However for film sources take care to properly detelecine.
-I don't need to deinterlace if it's for blu-ray.
-I've been using High Profile, with Level 4.1 too, for years now, and see no reason to change. I also keep the original resolution most of the time (unless I need a specific standard for, say, blu-ray).
Wow, other than a move to batch scripts about 2-3 years ago, and much more usage of QTGMC(), I've noticed that nothing's changed here for years with me regarding x264 encoding! Things are really smooth and stable here for me.I hate VHS. I always did.
I also have few doubts about the h264 codec settings, that i will point out one by one:
1. which AVC profile is the best for quality?
2. What is the 10bit encoding used for?
3. which of these presets are best for quality: slower, very slow & placeibo?
4. In the Frame-Type tab, what is the interlaced mode for?
5. In the Misc tab, What is the V.U.I settings used for & what it is the force SAR for?
6. Lastly in the Nero AAC audio settings, what AAC profile should i keep for best quality & are there any other settings to be tweaked?
1. AVC profile: High is best and the others should only be used for compatibility with older devices.
2. 10 bit gets you better quality at a lower bitrate but is not playable on many devices, but works fine on PC with the requisite codecs or player.
3. Placebo is pointless, except for testing. Very slow is best but takes a long time. Use Medium for most encodes and Slow or Very Slow only if you have the time.
4. I believe this is used when the source is interlaced and maintains interlaced video. Else you'd get a progressive video with interlacing artifacts
6. Keep in mind MeGUI down-mixes multi-channel audio to stereo by default. This can be adjusted. Also since audio files are not huge compared to video, I usually use a bitrate of >192k for 2 channel audio and >384k for 5.1
Last edited by blud7; 9th May 2016 at 17:36.
I'm asking about the AAC LC & HE AAC. Which one is the best?
HE AAC is best for very low bitrates, LC is fine otherwise.
For HD TV Rips?
Just use LC and you'll be fine.
And if it's a TV rip, try the high profile @lvl 4.1, CRF of ~21 should do.
Last edited by blud7; 9th May 2016 at 17:38.
In addition to what blud7 said:
Same with the level. The encoder will choose anything from level 3 to level 4.1 (maybe 4.2) depending on the resolution. I use Level 4.1 for everything myself, regardless of resolution, as all the players in our house support High Profile, level 4.1.
colour banding though. You'll probably have to wait until x265 is mainstream for 10 bit to be mainstream.
Most content created today is progressive but there's still a lot of older interlaced content about. It's mostly referred to as "video" (ie interlaced NTSC or PAL) as opposed to "film" which is progressive.
And 1080i is still used quite a bit for sports broadcasts.
SAR is generally not anything you have to worry about. MeGUI always sets it for you and it'll always be 1:1 unless you're using anamorphic encoding in MeGUI's script creator when you're encoding an anamorphic source such as a DVD. Without anamorphic encoding, enabling resizing will always resize a video to "square pixel" dimensions. ie SAR 1:1.
It's fun and games because there's different pixel aspect ratios (SARs) used for DVDs. Check out the list here:
V.U.I = Video Usability Info. Those settings have no effect on the way a video is encoded, they only provide information for a player to use on playback, which it'll often ignore anyway. If you must set anything, make sure you know it's correct, otherwise don't set anything at all, but the only one I'd bother with is "Colour Matrix".
High definition = bt709, PAL = bt470gb and NTSC = smpte170m.
Anything that supports AAC will play LC-AAC correctly. A player that doesn't support HE-AAC will still play the audio, but without any high frequencies.
I use LC-AAC with the variable bitrate mode and the default quality of Q0.5.
Thinking about it, if the AAC profile is left on automatic, the encoder will switch to one of the other modes if the bitrate/quality you specify is quite low, otherwise it'll be LC-AAC. At a quality of Q0.5 it'll always be LC-AAC. There's really nothing else to tweak.
Last edited by hello_hello; 10th May 2016 at 17:26.
Uber thanks for an uber explanation hello_hello.
And forgot to do add this doubt:
What encode mode to choose besides const. quality & automated 2nd pass? (is automated 3rd pass any better?)
uncompressed avi? are they your own movies you are looking to archive? You interested in bluray hardware compatibility? what is the resolution? Are they DV files?'Do I look absolutely divine and regal, and yet at the same time very pretty and rather accessible?' - Queenie
Hey! there hello _hello
While you're answering my above doubt, please answer to this one also:
Earlier you were talking about using yadif & bob alongside to deinterlace, but i heard that they tend to introduce some noise to the footage. So would you recommend me with the best yadif & bob settings to deinterlace that wouldn't create the noising effect. And i want to use them in Avisynth, so could you help me out in giving the links from where i can download them. And are there any dlls to be downloaded in order for them to run?
They are 1080i HDTV Captures.
Not sure why you want to deinterlace...I would use MeGui only if you want to go the route of custom encodes for bluray compliance. I use it to make proper video encodes for distribution on disk.
If all you want is to compress to a simpler format, use Handbrake. It has all the bubble pop-ups you need for help and is much easier to run woth CRF encoding. No need to worry about two-pass, unless you want proper hardware disc compliance for bluray.'Do I look absolutely divine and regal, and yet at the same time very pretty and rather accessible?' - Queenie
So does a 1080i gets played properly in a bluray player?
It's not like one will play better than the other, all things being equal. Just the same, both can play poorly - or not at all - if they were not encoded properly.I hate VHS. I always did.
If so, read here:
then use megui with options here:
If you just want files to play on a media player or PC, then use handbrake'Do I look absolutely divine and regal, and yet at the same time very pretty and rather accessible?' - Queenie
Automated 2 pass = you choose the average bitrate and the resulting quality will be the unknown.
Other than that, the two methods encode the video pretty much the same way, except CRF only requires 1 pass to encode the video. For 2 pass encoding the 1st pass is to work out how to distribute the specified number of bits (according to the specified bitrate) and the 2nd pass encodes. If you were to run a constant quality encode and make note of the resulting bitrate, then use that bitrate for a 2 pass encode, the two encodes would effectively be identical, hence one method lets you pick the quality and the other lets you pick the bitrate.
Most people here use constant quality. CRF18 is roughly where the x264 encoder is considered to be "transparent" (higher CRF values = lower quality and lower bitrate). I use CRF18 for 720p or lower resolutions and CRF20 for 1080p myself, but that's just me.
I think the benefit of a 3 pass encode over a 2 pass encode is quite minor. I've never run a 3 pass encode myself.
MeGUI's script creator and run an analysis under the de-interlacing section, if MeGUI detects the video as interlaced, it'll default to Yadif de-interlacing. That'll de-interlace PAL to 25fps progressive and NTSC to 29.970fps progressive. If you change the "Yadif" method to "Yadif with Bob" in the script creator, it'll de-interlace with Yadif to 50fps or 59.950fps instead. Motion will look smoother that way. De-interlacing to 50 fps or 59.940fps is how interlaced video is usually de-interlaced on playback by a video player or TV and the quality from "Yadif with Bob" will be fairly similar. There's nothing extra to download. MeGUI comes with Yadif.
There's quite a few de-interlacing methods that have their pros and cons, but Yadif is probably the most commonly used de-interlacer as it's fairly good and fairly fast. There's a de-interlacing script called QTGMC that does a better job (it's better than any player/TV de-interlacing) but it's also quite slow. Painfully slow for high definition.
You can use QTGMC with MeGUI but you need to download the plugins it requires yourself and add it to a script manually. Once you get it working it's not hard to use but it's easier if you also have Avisynth installed (MeGUI uses it's own portable version of Avisynth). There's some small Yadif vs QTGMC samples attached to these posts if you want to have a look, along with the original interlaced video if you want to compare them to your player's de-interlacing.