View Full Version : [x264] 2nd pass has more frames than 1st pass (xxx vs yyy)
dbmaxpayne
2nd June 2010, 07:17
Hi,
after many (many!) hours of encoding an 1080p stream I get the following error when I start the 2nd pass:
"x264 [error] 2nd pass has more frames than 1st pass (xxx vs yyy)"
The value of xxx is 2 frames higher than yyy.
I had this error 3 times before, but that was on an SD source, so I just encoded it again.
But I really don't have the time to encode this one again. :-(
How can I fix that???
Thank you in advance.
Mark
Edit: Of course I've not altered the source in any way :-)
Dark Shikari
2nd June 2010, 07:22
How are you encoding? You've given no information whatsoever about what you're actually doing -- you haven't even told us what software you're using.
dbmaxpayne
2nd June 2010, 07:44
I encoded via MeGui on an 64bit Windows 7, so vfw4x264.exe was used.
Commandline was:
"C:\Program Files (x86)\MeGUI\tools\x264\vfw4x264.exe" --preset placebo --tune film --pass 1 --bitrate 3375 --stats "M:\stats.stats" --thread-input --b-pyramid normal --rc-lookahead 250 --aq-mode 2 --zones 11128,11299,q=51 --sar 1:1 --output "M:\output.mkv" "M:\input.avs"
x264 --version:
x264 0.96.1613 81e75e9
built on May 26 2010, gcc: 4.4.4
Exact error was:
x264 [error]: 2nd pass has more frames than 1st pass (11300 vs 11298)
LoRd_MuldeR
2nd June 2010, 09:10
It would probably be interesting to post your AVS script. Certain source filters, such as DirectShow source, are NOT guaranteed to be frame-accurate.
This may be the reason why you got a different number of frames from the identical AVS script...
dbmaxpayne
2nd June 2010, 09:35
# Set DAR in encoder to 16 : 9. The following line is for automatic signalling
global MeGUI_darx = 16
global MeGUI_dary = 9
LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll")
AVCSource("M:\input.dga")
#deinterlace
#crop
#resize
#denoise
So no DirectShowSource is used
LoRd_MuldeR
2nd June 2010, 10:02
Might be some bug in DGAVCDecode or the (outdated) libavcodec it uses...
As you don't seem to do any "special" filtering in Avisynth, why do you need Avisynth input at all ???
You could try to feed your source (not the .dga file) into x264 directly. Any halfway up-to-date build of x264 should handle this (given the build was made with FFMS2 enabled).
Another option: Decode you input to a lossless HuffYUV AVI file once, then do the encoding passes from the intermediate AVI file.
Option three: Replace AVCSource() with DSS2(), which ships with Haali Media Splitter ("avss.dll"). You'll need suitable DirectShow spiltters+decoders for that option.
dbmaxpayne
2nd June 2010, 10:17
You could try to feed your source (not the .dga file) into x264 directly. Any halfway up-to-date build of x264 should handle this (given the build was made with FFMS2 enabled).
Hmm good idea for my future encodes :-), I've never tried to directly use the import streams
But like I said, I had this error a few times ago.
Back then I just restarted the encoding (nothing changed in scripts or input) and then it worked.
Strange..
Is there no way to use the already created stats file now? Maybe if I trim the avs-script by 2 frames? :-D
I've spend one week encoding (only first passes) three different encodes, all with the same error...
LoRd_MuldeR
2nd June 2010, 11:23
But like I said, I had this error a few times ago.
Back then I just restarted the encoding (nothing changed in scripts or input) and then it worked.
Strange..
This would even more indicate that there is an decoder-bug and some frames get lost now and then...
Is there no way to use the already created stats file now? Maybe if I trim the avs-script by 2 frames? :-D
I've spend one week encoding (only first passes) three different encodes, all with the same error...
If your decoder has problems with frame accuracy (which apparently is the problem here), the whole idea of 2-Pass encoding won't work anymore.
How do you know the lost frames got lost right at the beginning or right at the end?
So it's not only the problem that information for the first/last frames are missing, all information in the stats file might be off by a few frames...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.