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.

 

Go Back   Doom9's Forum > General > Newbies
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th December 2011, 00:21   #1  |  Link
firebo14
Registered User
 
firebo14's Avatar
 
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
firebo14 is offline   Reply With Quote
Old 26th December 2011, 00:26   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by firebo14 View Post
Sorry for this very newbie question...

The x264 settings are a bit hard to understand... what is the x264 settings for best quality (by the eye) and smallest size? I do not want lossless, it is too big.
Best possible quality, by definition, is lossless. Consequently your question is contradictory!

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.
LoRd_MuldeR is offline   Reply With Quote
Old 26th December 2011, 00:43   #3  |  Link
firebo14
Registered User
 
firebo14's Avatar
 
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
firebo14 is offline   Reply With Quote
Old 26th December 2011, 00:57   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
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>
Just one example:
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.
LoRd_MuldeR is offline   Reply With Quote
Old 26th December 2011, 04:48   #5  |  Link
CarlEdman
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).
CarlEdman is offline   Reply With Quote
Old 31st December 2011, 11:07   #6  |  Link
vrpatilisl
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.
Attached Files
File Type: doc Preset compare.doc (19.0 KB, 1189 views)

Last edited by vrpatilisl; 31st December 2011 at 11:13. Reason: attachment
vrpatilisl is offline   Reply With Quote
Old 1st January 2012, 06:57   #7  |  Link
firebo14
Registered User
 
firebo14's Avatar
 
Join Date: Mar 2010
Posts: 17
Thanks, LoRd_MuldeR and Carl Edman.. :]

Quote:
Originally Posted by vrpatilisl View Post
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.
Useful... thanks...

If anybody finds more very good settings, please post here.

Last edited by firebo14; 2nd January 2012 at 04:22. Reason: rule 12
firebo14 is offline   Reply With Quote
Old 1st January 2012, 07:16   #8  |  Link
vrpatilisl
Registered User
 
Join Date: Sep 2011
Posts: 144
hi
best setting according to me in Megui
.Crf 18 with sharktooth 1pass extra quality /insane(if u got time) preset, to get transperent Dvd rips
vrpatilisl is offline   Reply With Quote
Old 6th January 2012, 19:30   #9  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by vrpatilisl View Post
hi
best setting according to me in Megui
.Crf 18 with sharktooth 1pass extra quality /insane(if u got time) preset, to get transperent Dvd rips
Giving your preset a fancy name doesn't change the output to the better at all

You can probably achieve the same with an ordinary:
Code:
x264.exe --preset veryslow --tune film --crf 18
(Or, if encoding time really doesn't matter for you at all, replace "veryslow" with "placebo")
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 6th January 2012 at 19:36.
LoRd_MuldeR is offline   Reply With Quote
Old 7th January 2012, 03:46   #10  |  Link
firebo14
Registered User
 
firebo14's Avatar
 
Join Date: Mar 2010
Posts: 17
Thanks, Lord MuldeR, i will take your words because u are a Software Developer.
firebo14 is offline   Reply With Quote
Old 7th January 2012, 08:56   #11  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
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)
Ghitulescu is offline   Reply With Quote
Old 7th January 2012, 15:03   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
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.
LoRd_MuldeR is offline   Reply With Quote
Old 7th January 2012, 16:59   #13  |  Link
firebo14
Registered User
 
firebo14's Avatar
 
Join Date: Mar 2010
Posts: 17
Quote:
After all, the built-in Preset and Tuning system make things a lot easier for everybody.
Well said, LoRd MuldeR, as usual....

Quote:
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?

...best interest (not ALWAYS the smallest size)
That is the main reason why we have H264, it is to save space while maintaining transparent quality. Having the smallest size is the best there is... who wants a giant uncompressed video that is like 357 times bigger?.... D:


firebo14 is offline   Reply With Quote
Old 7th January 2012, 20:48   #14  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by firebo14 View Post
That is the main reason why we have H264, it is to save space while maintaining transparent quality. Having the smallest size is the best there is... who wants a giant uncompressed video that is like 357 times bigger?.... D:
All codecs were designed with this purpose in mind incidentally. And you removed from my quote exactly the phrase stating the same thing.

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)
Ghitulescu is offline   Reply With Quote
Old 8th January 2012, 15:18   #15  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Quote:
Originally Posted by Ghitulescu View Post
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.
So you're saying if you want to keep the file sizes down you need to tweak x264's settings regardless of which method you use?
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).
hello_hello is offline   Reply With Quote
Old 9th January 2012, 15:44   #16  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by hello_hello View Post
It'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).
For instance b-pyramids and reference frames, but increasing their number too much will make the video incompatible with the Blu-ray standard, and consequently playable only on a PC. Also the widespread technique of cropping out the black mattes will save some bits (thus space, much less than one may hope ) but again this will render the file incompatible with some standards.

So the smallest file size is not always a requirement.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 10th January 2012, 02:12   #17  |  Link
hello_hello
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.
hello_hello is offline   Reply With Quote
Old 21st February 2012, 15:37   #18  |  Link
Remicade
Registered User
 
Join Date: Dec 2009
Location: Romania
Posts: 98
I made some tests, i encode a sample (1080p) with presets ultra, medium, slow in MeGUI, I extract the same frame and compare. For an "amateur eye" I don't see any diference.
Remicade is offline   Reply With Quote
Old 21st February 2012, 15:52   #19  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by Remicade View Post
I made some tests, i encode a sample (1080p) with presets ultra, medium, slow in MeGUI, I extract the same frame and compare. For an "amateur eye" I don't see any diference.
You were comparing output files of identical size (identical average bitrate), right?

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.
LoRd_MuldeR is offline   Reply With Quote
Old 21st February 2012, 16:06   #20  |  Link
diogen
Registered User
 
Join Date: Dec 2005
Posts: 365
Quote:
Originally Posted by Remicade View Post
I made some tests, i encode a sample (1080p) with presets ultra, medium, slow in MeGUI, I extract the same frame and compare. For an "amateur eye" I don't see any diference.
Outcomes of tests like this are very dependent on:
- 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.
diogen is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.