Log in

View Full Version : [x264]Max GOP size of 50fps video is *2 - Bug?


NoX1911
13th October 2012, 21:26
Hallo,
i've encoded a 50fps video with MeGUI. I wanted 10sec I-frame interval so i set max gop size to 500 and minimum gop to 50. The command line was: program --level 4.2 --crf 18 --keyint 500 --output "output" "input"

The output video had 20 seconds I-frame interval though. Shouldn't this be 1000 frames max gop size? Then i encoded the same video with 250/25 gop size and it resulted in a 10 sec I-frame interval (checked with avidemux).

So, is 250/25 always 10 seconds I-frame interval independent of source video fps or is it a bug?

MeGUI v2192
x264 v2216

LoRd_MuldeR
14th October 2012, 14:35
If you open the encoded H.264 stream in MediaInfo (or a similar tool that can read the x264 info tag), what do "keyint=" and "keyint_min=" say?

Also: If you look at the x264 log while encoding, what framerate does x264 detect? Does it actually detect the input as 50 fps?

ffms [info]: 704x400p 1:1 @ 25/1 fps (vfr)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile High, level 3.0
[6.3%] 436/6948 frames, 78.93 fps, 445.40 kb/s, eta 0:01:22

NoX1911
14th October 2012, 18:12
MeGUI 250/25:
program --level 4.2 --crf 18 --output "output" "input"

Output file analysis:
MediaInfo:
keyint=500 / keyint_min=50
x264 log:
--[Information] [14.10.2012 18:36:48] Job commandline: "D:\Program Files\MeGUI_dev\tools\x264\x264.exe" --level 4.2 --crf 18 --keyint 500 --sar 1:1 --output "E:\!720x576-250.mkv" "E:\!720x576.avs"
---[NoImage] avs [info]: 720x400p 1:1 @ 50/1 fps (cfr)
---[NoImage] x264 [info]: using SAR=1/1

MeGUI 500/50:
program --level 4.2 --crf 18 --keyint 500 --output "output" "input"

Output file analysis:
MediaInfo:
keyint=1000 / keyint_min=100
x264 log:
--[Information] [14.10.2012 18:52:40] Job commandline: "D:\Program Files\MeGUI_dev\tools\x264\x264.exe" --level 4.2 --crf 18 --keyint 1000 --min-keyint 100 --sar 1:1 --output "E:\!720x576-500.mkv" "E:\!720x576.avs"
---[NoImage] avs [info]: 720x400p 1:1 @ 50/1 fps (cfr)
---[NoImage] x264 [info]: using SAR=1/1

Looks like MeGUI is spawning a wrong command line with keyint*2 even though it shows the correct one in 'configuration dialog'. Also, if i manually execute x264.exe with --keyint 500 it is 500 indeed afterwards so it doesn't look like an x264 bug.

Do you handle this or should i post it in MeGUI thread again?

Edit:
My test script:
ColorBars().ConvertToYV12(matrix="PC.601").killaudio
Assumefps(50)
trim(0,1500)
PointResize(320,240)

LoRd_MuldeR
14th October 2012, 19:28
So this all turns out to be the result of a "wrong" command-line and x264 is doing the exactly right thing (given the commnd-line it got).

Please post the issue in the MeGUI support thread, if it can be reproduced with the latest MeGUI...

Zathor
14th October 2012, 20:11
You have to specify the fixed mode for GOP calculation in the MeGUI preset if you really want to have a fixed value. Otherwise the default mode "FPS based" will be used where 25fps is the bias.

So your 500 will be divided by 25fps and multiplied with your source fps (50) resulting in a value of 1000.

NoX1911
14th October 2012, 20:35
Thx, now i get it. I've also found the corresponding mouse over info as well (that explains the calculation). It maybe would be easier to understand in the first place if there would be a secondary field showing the actual I-frame interval (in seconds).

Edit: Or even better... just rename 'FPS based' into '25FPS based'.
It's also confusing that the command line in the 'configuration dialog' doesn't reflect that calculation. It always shows the user-defined keyint.