Log in

View Full Version : Is the x264 "--tune film" setting film only?


me7
7th September 2009, 19:02
I encode some music videos with x264 right now and I was wondering if the --tune film setting is intended strictly for film only or for all live action sources.

Firebird
7th September 2009, 19:12
For all live action.

LoRd_MuldeR
7th September 2009, 19:21
Well, here "film" means real-life footage (which usually contains a decent amount of film grain) and similar, as opposed to Anime/Cartoon/CGI.

So if your "music video" is real-life footage with some grain, then "--tune film" will be suitable indeed. But if your video clip is animated, then "--tune animation" may be more suitable.

me7
7th September 2009, 19:58
Is videotape compareable to film in terms of grain?

LoRd_MuldeR
7th September 2009, 20:06
Is videotape compareable to film in terms of grain?

While video tapes certainly have their own kind of artifacts, I think the "--tune" option is not so much about the type of the storage media, but about the kind/origin of the content.

Therefore I would choose the "--tune" option depending on what kind of content (real-life vs. animated) is stored on your video tape...

Lyris
7th September 2009, 22:55
I didn't know of this setting - can someone explain what it's doing behind the scenes? Is it to avoid corrupting film grain or other high frequency noise (eg from CCD/CMOS video camera sensor)?

nurbs
7th September 2009, 23:14
You can read about what the tunings do here (http://mewiki.project357.com/wiki/X264_Settings). --tune film sets deblock to -1:-1 and psy-trellis to 0.15. There is also a tuning to keep grain better.

Sagekilla
7th September 2009, 23:15
--tune film sets deblock to -1:-1 and psy-trellis to 0.15. Nothing more than that.

All it really does is enable options which are known to help filmic content retain sharpness and grain (deblock and psy-trellis respectively).

There's no secret tuning of parameters that you only get from use --tune, just enabling of plain sight options.

chipzoller
8th September 2009, 01:59
Is that to say these settings, either manually or through --tune film, are recommended/safe for all live action material?

LoRd_MuldeR
8th September 2009, 02:12
Is that to say these settings, either manually or through --tune film, are recommended/safe for all live action material?

I don't think that attributes like "live" or "action" matter here. The nature of the footage does matter. It certainly helps to keep the crispiness of "real life" footage - action or not.

At the same time it may not be the best idea to use that for "animated" content, which usually doesn't have much texture and grain, even if there is a lot of action in it...

chipzoller
8th September 2009, 02:14
Then let me clarify: Would using --tune film be safe and beneficial for all "real life" DVD encodes?

LoRd_MuldeR
8th September 2009, 02:22
Then let me clarify: Would using --tune film be safe and beneficial for all "real life" DVD encodes?

It's safe for sure, because deblock -1:-1 and psy-trellis 0.15 certainly won't do anything horrible to your encode ;)

The question is whether "--tune film" is beneficial for your source compared to the defaults. And that generally is the case with "real-life" footage or "filmic" content.

However it still may depend on the individual source and on your personal preferences. Also deblock -1:-1 may not be the best idea for ultra-low bitrates...

chipzoller
8th September 2009, 02:25
Most commercial DVD encodes done at CRF=21 should generally be helped by this preset then?

LoRd_MuldeR
8th September 2009, 02:27
Most commercial DVD encodes done at CRF=21 should generally be helped by this preset then?

How many times do you need the answer? Commercial or not, if your DVD source contains anything similar to "film" material (that is: not Anime, Cartoon or CGI), then it should help, yes!

But it can't be guaranteed for any single source that exists out there. There never is a guarantee for any setting to be perfect for all sources. At this point you should do some testing and see yourself :rolleyes:

The "--tune film" option even isn't necessarily bad for all animated sources, because animated sources may use "film look" effects (e.g. fake grain), which would make it behave more like film.

(BTW: It's not a preset, it's a tuning. Those are separate! Presets help to control speed -vs- quality. Tunings help to fine-tune the encoder for a specific type of content/result)

chipzoller
8th September 2009, 02:29
How many times do you need the answer? At this point you should do some testing and see yourself
I prefer confirmation from the experts, but I'm running tests now :) Thanks

LoRd_MuldeR
8th September 2009, 02:35
I prefer confirmation from the experts

Then we can only hope that one of the "experts" will finally reply to this thread :D

Chengbin
8th September 2009, 03:13
I prefer confirmation from the experts, but I'm running tests now :) Thanks

I would consider someone with almost 7000 post to be at least somewhat knowledgeable.:)

Just so you understand. The expert does not post just to confirm. He only posts when there is misinformation, or he answers the question.

ajp_anton
8th September 2009, 06:37
I would consider someone with almost 7000 post to be at least somewhat knowledgeable.:)

Just so you understand. The expert does not post just to confirm. He only posts when there is misinformation, or he answers the question.To specify: answers an unanswered question =)

chipzoller
11th September 2009, 15:13
I've experimented around with the --tune film option via MeGUI and found either a problem with what I'm doing or the settings it should set. Once I check the encoded files with AVInaptic, it reports -psy-rd to be 1.0:0.0 when, according to the wiki (http://mewiki.project357.com/wiki/X264_Settings#tune), it should be 1:0.15. These files were generated with CRF=21 with the -very slow preset (command line below). From reading the wiki, the --tune option is to be applied after the preset, so I thought any options set within the --tune setting should supersede any conflicting options (such as --deblock and --psy-rd). What am I missing?

program --profile high --preset veryslow --tune film --crf 21 --thread-input --deblock -1:-1 --bframes 4 --b-adapt 2 --b-pyramid --direct auto --b-bias 0 --scenecut 40 --ref 5 --rc-lookahead 40 --no-mbtree --aq-mode 1 --aq-strength 1.0 --merange 16 --me tesa --subme 9 --partitions all --trellis 2 --psy-rd 1.0:0 --output "output" "input"

Using x264 r1251 and MeGUI 0.3.1.1056

talen9
11th September 2009, 15:18
The GUI settings does not reflect the tuning, meaning that if you choose the "film" tuning and then you go to the advanced settings, the Psy-RD values won't have changed to the 1:0.15 of the tuning; they will be the one from the MeGUI preset that you have selected.

And you have to remember that every option explicitly passed on the command line (so, every personalized MeGUI setting) will override the ones set by "--tune" or "--preset".

LoRd_MuldeR
11th September 2009, 15:19
I thought any options set within the --tune setting should supersede any conflicting options

No, the opposite is the case: First of all "--preset" and "--tune" are evaluated. Then user options are applied and may overwrite everything that has been set so far!

So with "--tune film [...] --psy-rd 1.0:0" you first set Psy-Trellis to 0.15 via film tuning, but then you explicitly force Psy-RD back to 0.0 ;)

Maybe you were thinking of the "--profile" option. That option indeed will be applied last and it will overwrite all user settings, if needed to ensure profile compliance...

(BTW: The order in which the parameters appear in your command-line is irrelevant)

chipzoller
11th September 2009, 16:27
I see. Thanks for the explanation.

chipzoller
20th September 2009, 04:09
I ran another series of tests, this time setting the --tune film option and --psy-rd 1.0:0.15 to see if anything strange would result. All 3 test files reported, through AVInaptic, -psy-rd=1.0:0.2. What would be the reason for this? And since the other user-set options will override the --tune setting, and I can't turn off --psy-rd through MeGUI (0.3.1.1056), what is recommended when using the --tune option through MeGUI at the current time?

BTW, thanks to DS for implementing mbtree as it makes a big improvement I've noticed.

kemuri-_9
20th September 2009, 04:43
x264 only writes psy-rd values to 1 decimal place,
so 1.0:0.15 gets written to the signature as 1.0:0.2

chipzoller
20th September 2009, 15:20
Thanks. Any recommendations on my question regarding MeGUI settings?

kemuri-_9
20th September 2009, 16:15
I don't use meGUI, but i recall it has a section to directly add parameters to the commandline,
use this until it supports the preset system.

talen9
20th September 2009, 17:23
Check again, 'cause I have MeGUI 0.3.1056 and I *can* turn off PsyRD ... if by "I can't turn off PsyRD" you mean that you're seeing the PsyRD options greyed out, it's because you've currently selected a too low SubPixel Refinement level (the option right above Psyrd), it has to be at least at 6 for PsyRD to be active.

And when it's greyed out, it is *off* ;)

chipzoller
20th September 2009, 17:29
Subme is set to 9 so the option is not greyed out. That's why I asked how to deactivate a certain option through the GUI (even though extra commands can be injected via the custom command line).

talen9
20th September 2009, 22:25
Well, if you put both Psy-RD's and Psy Trellis' strenghts at zero, you'll have them turned off even with subme>6 , IIRC .

burfadel
20th September 2009, 22:45
Any individual settings you make override the tune settings. As in the previous example, if you specify '--tune film', which sets the psy-rd to 1.0:0.15, then set the psy-rd manually to 1.0:1.0 (for instance) then the 1.0:1.0 will take precedence. If you are using a gui to automate the procedure for you, its quite possible that you have set different values for psy-rd etc which overrides the settings of --tune. In other words, check the command line and see whats happening!

The --tune presets are just really suggestions of values for certain options that have been known to provide good results for that type of source material. The settings required by 'American Dad' would most likely be different to those required by 'Final Fantasy' for optimal results relating to your preference in the final encode. Aside from issues of gui's overriding the tune settings... Saying that --tune will always benefit the type of material will be like saying 'The sky is blue'. Yes, the sky is blue, but it isn't blue at nighttime or when its cloudy!

chipzoller
21st September 2009, 00:05
@talen9: I'm aware of this, however I don't want the option turned off, and it really isn't turned "off" but rather the values set to 0's, which for reasons already made clear to me both by Maestro Mulder above and burfadel below, this will override the --tune options.

@burfadel: I'm also aware of the command order, and so without being able to remove the --psy-rd option (or --deblock), only to change it's values, for now in MeGUI I'd have to set both to the values --tune film is going to set. What's missing in the gui is a "not configured" option where instead of disabling or zeroing-out a setting once unchecked, you would have the option of not configuring that setting at all. Either this or in addition to the "Custom Command Line" option in the "Misc" tab, rename it "Adjust Command Line" which allows you to do both adding and removing commands (the removal of certain ones causing those respective options to be disabled in the gui). Thanks for the suggestions.

talen9
21st September 2009, 01:01
Sorry chipzoller, I actually had the feeling that I wasn't catching correctly your questions ... and to tell the truth, I still don't :(

ProVision
19th July 2013, 22:36
You know what that tuning does, so just type them in manually.

I hope you've figured THAT out in 5 years xD

an3k
23rd January 2016, 20:01
Thanks for that old and long thread. For me Film is ... was ... something with 29.976 fps (DGIndex / MeGUI anyone?) so I never used that tuning. And until now I never researched it actual meaning :)