View Full Version : Which tune option to set when encoding gameplay video?
orion44
29th September 2010, 14:29
Hello...
I want to record a gameplay video with FRAPS,
and then encode it with x264. It's a FPS war game for PC.
For this type of video, should I use the tune film or tune animation option,
or maybe just use the x264 default settings without the tune option?
nm
29th September 2010, 19:38
Tune film is probably most suitable for your footage. Tune animation is for cel-type drawings with sharp edges and large flat areas.
Gser
29th September 2010, 19:44
Nay, as it has no grain use default.
orion44
29th September 2010, 19:46
Tune film is probably most suitable for your footage. Tune animation is for cel-type drawings with sharp edges and large flat areas.
Thank you, I was just about to encode the video,
and I didn't know which option to use.
orion44
29th September 2010, 19:53
Nay, as it has no grain use default.
Now that I read your reply, I'm not sure which option to use,
tune film or the default without tuning?
LoRd_MuldeR
29th September 2010, 20:00
Nay, as it has no grain use default.
Some games do have grain nowadays. It's called "film effect" ;)
Now that I read your reply, I'm not sure which option to use,
tune film or the default without tuning?
In that case you should create two encodes from the same source and at the same file size (same average bitrate), one with "--tune film" and one without, while all other settings remain unchanged.
Then decide which one looks better to your eyes ;)
(BTW: Didn't x264 have a "touhou" preset, optimized for Touhou Project game-play videos, not too long ago? Apparently that preset is gone now. Yikes!)
nm
29th September 2010, 20:00
Nay, as it has no grain use default.
Well, I'm not sure about psy-trellis with this kind of source, but deblock=-1:-1 should help when encoding detailed (finely textured) sources.
Now that I read your reply, I'm not sure which option to use,
tune film or the default without tuning?
Test both and see for yourself. If tune film seems worse, also try defaults + deblock=-1:-1.
orion44
29th September 2010, 20:26
OK, I will test both options.
BTW, in between the levels, the game shows old video footage from WW2.
LoRd_MuldeR
29th September 2010, 20:38
BTW, in between the levels, the game shows old video footage from WW2.
That definitely sounds like a case for "film" tuning.
x264 does support zones, but it seems you cannot change the tuning (or the corresponding options) for individual zones currently.
In case you really need to use different tunings for the "in game" scenes and for the "video footage" scenes, you can encode them separately and join together the pieces afterwards.
But before you do that, you should try to find settings that give reasonable results for both types of scenes...
J_Darnley
29th September 2010, 22:31
(BTW: Didn't x264 have a "touhou" preset, optimized for Touhou Project game-play videos, not too long ago? Apparently that preset is gone now. Yikes!)
I don't know where you got that idea from. ;)
LoRd_MuldeR
29th September 2010, 22:41
I don't know where you got that idea from. ;)
http://git.videolan.org/gitweb.cgi?p=x264.git;a=commitdiff;h=8ab4907f5a550ac17356609522b3426650ba3029 :eek:
sneaker_ger
29th September 2010, 22:45
--tune touhou should still exist. (Though I don't know if it's supposed to be for the games or the anime)
/edit: or does it do nothing anymore? *testing*
/edit2: at least deblocking gets changed with it
LoRd_MuldeR
29th September 2010, 22:48
--tune touhou should still exist. (Though I don't know if it's supposed to be for the games or the anime)
I think it's for the game:
http://mirror05.x264.nl/Dark/x264vsElecard/
And yes, the "touhou" tuning still exist in the code. It just isn't documented in the help anymore.
orion44
29th September 2010, 23:03
I just tested the --tune film option at 600 kbit/s, and the video looks amazing,
so I won't bother testing the video with the default settings.
However, when encoding with x264, I get the following warning message:
resize [warning]: converting from bgra to yuv420p
Since I used FRAPS for recording, I think FRAPS only works in RGB color format.
Is there a way to fix this, so I don't get warning messages?
Here is my AVISynth script:
AVISource("G:\Temp\Part1.avi", false)
#Crop(0,16,640,448)
#Trim(1825,1950)
And here is my x264 batch script:
x264.exe --tune film -I 250 -i 25 -r 4 -B 600 -p 1 --stats G:\Temp\Stats.log --direct auto -o G:\Temp\x264.mkv G:\Project\AVISource.avs
x264.exe --tune film -I 250 -i 25 -r 4 -B 600 -p 2 --stats G:\Temp\Stats.log --direct auto -o G:\Temp\x264.mkv G:\Project\AVISource.avs
LoRd_MuldeR
29th September 2010, 23:08
You don't need to worry about the warning. It only means that your source was converted from RGB32 to YV12, which is required anyway. x264 currently only supports YUV 4:2:0.
Unless I'm mistaken, x264 now supports higher bit-depths than 8-Bit (when compiled accordingly), but YUV 4:4:4 or YUV 4:2:2 still isn't supported. And of course RGB isn't supported either.
Actually you could get rid of the warning, simply by putting a ConvertToYV12() at the end of your Avisynth script. But it wouldn't change anything, the data still is converted to YV12.
J_Darnley
29th September 2010, 23:10
However, when encoding with x264, I get the following warning message:
resize [warning]: converting from bgra to yuv420p
Since I used FRAPS for recording, I think FRAPS only works in RGB color format.
Is there a way to fix this, so I don't get warning messages?
Of course not. x264 doesn't support rgb
orion44
29th September 2010, 23:26
You don't need to worry about the warning. It only means that your source was converted from RGB32 to YV12, which is required anyway. x264 currently only supports YUV 4:2:0.
Unless I'm mistaken, x264 now supports higher bit-depths than 8-Bit (when compiled accordingly), but YUV 4:4:4 or YUV 4:2:2 still isn't supported. And of course RGB isn't supported either.
Actually you could get rid of the warning, simply by putting a ConvertToYV12() at the end of your Avisynth script. But it wouldn't change anything, the data still is converted to YV12.
Excellent.
Thanks.
Warperus
30th September 2010, 08:21
Actually you could get rid of the warning, simply by putting a ConvertToYV12() at the end of your Avisynth script. But it wouldn't change anything, the data still is converted to YV12.
Actually you have to put ConvertToYUV12(matrix="Rec709") to make proper conversion.
Otherwise you either get wrong color transformation or set fullrange flag in command line and hope player will handle pc levels material properly.
J_Darnley
30th September 2010, 09:54
Actually you have to put ConvertToYUV12(matrix="Rec709") to make proper conversion.
Otherwise you either get wrong color transformation or set fullrange flag in command line and hope player will handle pc levels material properly.
The default is Rec601, how is that wrong? It certainly isn't fullrange. Okay, many decoders might assume 709 for HD but as far as I can tell this isn't.
Warperus
30th September 2010, 10:51
The default is Rec601, how is that wrong? It certainly isn't fullrange. Okay, many decoders might assume 709 for HD but as far as I can tell this isn't.
Rec601 is actually full range (rgb 0.0.0 becomes luma 0, 255.255.255 becomes luma 255).
Fraps creates video in full range.
AVCHD default is TV.709 - it is what player expects reading file without specifically set color schema.
Didée
30th September 2010, 11:53
Rec601 is actually full range (rgb 0.0.0 becomes luma 0, 255.255.255 becomes luma 255).
For Avisynth's Convert*() functions it's the other way round.
Rec.601 and Rec.709: RGB 0,0,0 <=> YUV luma 16 // RGB 255,255,255 <=> YUV luma 235
PC.601 and PC.709: RGB 0,0,0 <=> YUV luma 0 // RGB 255,255,255 <=> YUV luma 255
GodofaGap
30th September 2010, 13:38
Rec601 is actually full range
No its not.
orion44
30th September 2010, 16:30
The gameplay video is recorded in 640x480 resolution.
So, I will add ConvertToYV12() to my avisynth script.
Can someone confirm if this is the correct method for color conversion with FRAPS recorded SD videos?
J_Darnley
30th September 2010, 17:02
It is fine.
orion44
30th September 2010, 18:03
OK, thanks.
orion44
1st October 2010, 11:19
I've searched in google, and I found a way to encode FRAPS video directly in YV12,
without RGB to YV12 color conversion.
I downloaded ffms2 (http://code.google.com/p/ffmpegsource/) and ColorMatrix (http://bengal.missouri.edu/~kes25c/ColorMatrixv25.zip) filters for AviSynth, and used the following AviSynth script:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ffms2\ffms2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMatrix\ColorMatrix.dll")
FFVideoSource("G:\Temp\Part1.avi", cache=false)
ColorMatrix(inputFR=true)
FRAPS decoder decodes in RGB, but this ffms2 thing decodes directly in YV12.
So far, it's working perfect!
LoRd_MuldeR
1st October 2010, 11:50
FFVideoSource() has an optional 'colorspace' parameter.
Gser
1st October 2010, 14:47
Some games do have grain nowadays. It's called "film effect" ;)
Yes, which any decent gamer will turn off. ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.