Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
26th December 2011, 00:21 | #1 | Link |
Registered User
Join Date: Mar 2010
Posts: 17
|
x264 very good quality and smallest size?
Sorry for this very newbie question...
The x264 settings are a bit hard to understand... what is the x264 settings for very good quality (by the human eye) and smallest size? I do not want lossless, it is too big. Thanks... Last edited by firebo14; 7th January 2012 at 03:45. Reason: rule 12: don't ask for best |
26th December 2011, 00:26 | #2 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
And even if you don't want "best" quality (lossless), but just "very good" quality (like "transparent" quality), it should be clear that you can get this and "smallest size" at the same time Video compression always is a trade-off between quality (compression artifacts) and file size (bitrate). Though using "slower" settings can improve the "quality per bit" ratio. Consequently, using the slowest x264 preset that you can afford speed-wise in combination with the highest CRF value that you can accept quality-wise, is as close as possible to what you want. Using the suitable tuning option for the type of your source certainly doesn't hurt either. Pre-processing, like strong denoising, can further reduce the bitrate requirement...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 26th December 2011 at 00:39. |
|
26th December 2011, 00:43 | #3 | Link |
Registered User
Join Date: Mar 2010
Posts: 17
|
Oh hey again LoRd_MuldeR .
Ah, sorry... i meant 'very very very very very very very good' (yes, 7 'verys') as in the human eye would not tell the difference. I am using a different encoder, the command prompt version (from http://www.x264.nl/). I am new to this command prompt. May u post the 'very very very very very very very good' command line settings? Oh please, Lord or someone. And in this here (http://mewiki.project357.com/wiki/X264_Settings#psnr), does psnr, ssim, deblock, and many others improve quality and smaller size? Thanks again for your help |
26th December 2011, 00:57 | #4 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
There is no exact/universal definition of "visually lossless" quality, because everybody can have his/her own opinion on this
So do what has been suggested before: Encode with CRF mode and use the highest possible CRF value that still meets your quality requirements. Something like CRF=16 will certainly give you very good quality. In case that still doesn't satisfy you, try 14 or 12. And so on. If you want to keep the bitrate as low as possible at the same time, encode with the slowest preset that you can accept speed-wise. It's as simple as that. But keep in mind that CRF mode only gives approximately(!) the same quality for the same CRF value as long as you don't change other influential settings. Consequently you may need to rescale your CRF value after switching to a different preset! Commandline: Code:
x264.exe --preset <preset_of_your_choice> --tune <tune_that_matches_your_source> --crf <crf_value_of_your_choice> -o <output> <input> Code:
x264.exe --preset veryslow --tune film --crf 16 -o "c:\foo\encoded.mkv" "c:\foo\source.avs" You don't have to worry about any other commadline switches, unless you have additional requirements, such as BluRay compatibility for BluRay authoring. The options that effect 'quality -vs- speed' or tweak x264 for a specific source-type are already covered by the preset/tuning system. BTW: SSIM and PSNR are quality metrics. They can give a (very rough!) estimate of the quality of your encode, but they don't change the output (details).
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 26th December 2011 at 15:25. |
26th December 2011, 04:48 | #5 | Link |
Registered User
Join Date: Jan 2008
Posts: 185
|
Lord_Mulder, as usual, is absolutely right.
I have used nearly identical setting for years (as you have heard, except crf 17, rather than 16--the trade-off between size and quality is just a little different for everybody; many consider crf 18 to be transparent and find even higher values acceptable). For what it is worth, on a Core 2 i970 (6 cores, 12 threads), with a demanding avisynth script (including MDegrain3), these settings typically encode in about real-time for SD (e.g., DVD resolution) and about one fifth of real-time for telecined HD content, i.e., 1080p24 (though I use a substantially higher crf for HD sources). |
31st December 2011, 11:07 | #6 | Link |
Registered User
Join Date: Sep 2011
Posts: 144
|
hi
I also strugled to get this done. As the expert say crf 18 gives best result. I tried lossles it is useless time and space wise. i have compared some presets in megui and vidcoder very slow preset and it shows me that extra quality preset (sharktoth) given best quality to size. See the attach. Last edited by vrpatilisl; 31st December 2011 at 11:13. Reason: attachment |
1st January 2012, 06:57 | #7 | Link | |
Registered User
Join Date: Mar 2010
Posts: 17
|
Thanks, LoRd_MuldeR and Carl Edman.. :]
Quote:
If anybody finds more very good settings, please post here. Last edited by firebo14; 2nd January 2012 at 04:22. Reason: rule 12 |
|
6th January 2012, 19:30 | #9 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
You can probably achieve the same with an ordinary: Code:
x264.exe --preset veryslow --tune film --crf 18
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 6th January 2012 at 19:36. |
|
7th January 2012, 08:56 | #11 | Link |
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
I frankly don't understand why people keep on asking this: What settings give the best (very good, etc.) quality at the smallest file size?
Who's gonna encode for the lowest quality and biggest size? Or at the same quality () at a higher file size? People suffering from Horror vacui? The reason these parameters exist is to give one the freedom to set the encoder to suit his best interest (not ALWAYS the smallest size). You're unhappy to experiment yourself, then pick up the first link in google, you only have to press three buttons three times: Select source, Select destination, Go/Run, these software will pick automatically the best profile for you .
__________________
Born in the USB (not USA) |
7th January 2012, 15:03 | #12 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Well, x264 has quite a huge number of options that can be tweaked. And it's easy to ruin your encode with inconsiderate parameter modifications
If you are new to x264 (or video encoding as a whole) it's hard to understand which settings can/should be tweaked for what reason - and which better should not be touched. To make things worse, you'll find loads of "recommendations" about x264 settings on the net - some are well-grounded, some are outdated nowadays and some are just misleading/nonsense. Also not everybody has the "scientific background" and/or the motivation to run in-depth tests with all possible parameter combinations After all, the built-in Preset and Tuning system make things a lot easier for everybody. Most users should never need to overwrite anything, just pick your Preset/Tuning and be happy. One problem is that many GUI front-end's for x264 still implement their own Preset system - rather than just passing through the user's Preset choice to x264... (Implementing presets in the GUI program might have been a great feature before x264's own Preset system was available, but it's just redundant and confusing nowadays)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 7th January 2012 at 15:16. |
7th January 2012, 16:59 | #13 | Link | ||
Registered User
Join Date: Mar 2010
Posts: 17
|
Quote:
Quote:
|
||
7th January 2012, 20:48 | #14 | Link | |
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
Quote:
However, there are two fundamental approaches: 1. existing bit budget constrains: the final size is known, so the average bit rate, the only issue is to find the right parameters to distribute these bits according to the complexity of the scenes, so the final video would look as transparent as possible in these conditions 2. quality issues constrains: one has the "transparent" thing in mind and tweaks the settings accordingly, however the end video size is not known beforehand, only guesstimated. Of course one can encode 3hours of FullHD into 700MB final size by keeping the quality "transparent", just that the same one has to redefine the meaning of "transparent". And of course Lord_Mulder is right, just read all that he said, not just the convenient bits thereof.
__________________
Born in the USB (not USA) |
|
8th January 2012, 15:18 | #15 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Quote:
I'd be interested to know which settings can be tweaked to reduce the file size while maintaining the quality and/or why they're not the default settings. I'm not saying there aren't ways to tweak the encoder to reduce the file size while maintaining quality... I don't actually know (aside from using the speed presets). |
|
9th January 2012, 15:44 | #16 | Link | |
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
Quote:
So the smallest file size is not always a requirement.
__________________
Born in the USB (not USA) |
|
10th January 2012, 02:12 | #17 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
I don't know why it's always just Bluray player vs PC. Bluray players and PCs aren't the only two devices capable of playing video. A quick look at MeGUI's x264 configuration dialogue indicates the PS3 and WDTV can both play video well outside of the official Bluray standard, as I suspect can many Bluray players capable of playing alternative file types. I'm fairly confident mine will, as will the media players in the TVs.
I'd agree with LoRd_MuldeR. Unless you really know what you're doing it pays to simply stick to x264's own presets. B-frames and reference frames etc seem to be adequately covered. When it comes to device compatibility... well you need to know what a device will and won't play whether you tweak x264's settings or not. I find that's where a decent GUI can be useful if you're not sure which encoder settings are required. In the case of MeGUI it'll let you change the x264 preset (or fiddle with x264's settings manually) but selecting a target device option will get MeGUI to add to the command line whichever parameters are required for that device. As best as I can tell they're generally parameters relating to profile, frame type or rate control. Settings which don't effect hardware compatibility are left alone. Personally I just stick to x264's speed presets and whatever MeGUI adds for device compatibility as I'm not expert enough to fiddle with x264's parameters manually. I doubt the majority of people would be. |
21st February 2012, 15:52 | #19 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
But even then, your observation only means that the test was done at a bitrate at which even the Ultrafast preset gave good quality. If you pick a bitrate at which even the "fastest" preset in the test gives "transparent" quality, then the "slower" presets can not look even better However the conclusion that there is no difference would be wrong. At a lower bitrate the difference would probably be visible... (If we didn't consider the bitrate, we could use MPEG-2, crank up the bitrate to get excellent quality and conclude that H.264 is no better ^^)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 21st February 2012 at 16:12. |
|
21st February 2012, 16:06 | #20 | Link | |
Registered User
Join Date: Dec 2005
Posts: 365
|
Quote:
- material (animation, film, video, etc.) - source (MPEG-2, -4, etc.) - make (CGI, RED, film, etc.) - grain - player (computer, PCH-type media player, BD player, etc.) - TV/projector (calibrated?) - experience... Diogen. |
|
|
|