plugh
14th November 2006, 05:57
I am seeing a problem wherein part way through my second pass I start seeing a pattern, both in the Vdub video frame size display while encoding, AND in the drfanalyzer graphic after encoding. The pattern is that at scene changes the P frame immediately preceding the I frame that starts the new scene has grown *significantly* compared to the same sequence of frames in the 'full quality' first pass encode.
The problem begins after the one and only N-VOP appears in the first pass AVI file.
Now bear with me, I think my evidence is compelling.
The encodes -
As I said first pass is full quality, and I keep the output avi.
Second pass is sized basically the same as the first pass; from examination of framesize patterns, there isn't any under/over correction going on. That is, no periodic 'higher quant/lower size' or 'lower quant/higher size' frames occur comparing 1st and 2nd pass output files. Thus there shouldn't be any frame size differences (except I-frame boost).
The two png's show drfanalyzer snapshots of the same sequence of frames from the 1st and 2nd pass output files. It's a little difficult to see, but the orange lines immediately preceding the black I-frame lines are significantly larger, even though they are at the same quant. Note that the fourth I-frame, not at a scene boundary, doesn't exhibit this pattern. (Side note: I have requested an enhancement to mpeg4modifier to include frame size so this can be more easily observed).
The only rationale I could come up with for this behaviour was if somehow the first frame of the new scene was being encoded as the final frame of the preceding scene. I investigated and think I found where things seem to go wrong.
What follows is a side by side comparison of the first pass output file and frame lists of both 1st and 2nd pass avis (generated by Mpeg4modifier). I have taken the liberty of adding frame numbers to the .pass file and reordering the mpeg4modifier frame lists into time order to match the .pass file.
1st pass avi file 1st pass out/2nd pass input 2nd pass avi file
51848: I-VOP (0:36:02.212) 051848. i 2 2720 0 0 77089 10591 51848: I-VOP (0:36:02.212)
...
52070: B-VOP (0:36:11.428) 052069. b 3 0 2720 0 11 11 52070: B-VOP (0:36:11.428)
52069: P-VOP (0:36:11.470) 052070. p 2 0 0 2720 360 360 52069: P-VOP (0:36:11.470)
52072: B-VOP (0:36:11.512) 052071. b 3 0 2720 0 16 16 52072: B-VOP (0:36:11.512)
52071: P-VOP (0:36:11.553) 052072. p 2 0 0 2720 383 383 52071: P-VOP (0:36:11.553)
52074: B-VOP (0:36:11.595) 052073. b 3 0 2720 0 11 11 52074: B-VOP (0:36:11.595)
52073: P-VOP (0:36:11.637) 052074. p 2 0 0 2720 360 360 52073: P-VOP (0:36:11.637)
52076: B-VOP (0:36:11.678) 052075. b 3 0 2720 0 11 11 52076: B-VOP (0:36:11.678)
52075: P-VOP (0:36:11.720) 052076. p 2 0 0 2720 360 360 52075: P-VOP (0:36:11.720)
52078: B-VOP (0:36:11.762) 052077. b 3 0 2720 0 12 12 52078: B-VOP (0:36:11.762)
52077: P-VOP (0:36:11.803) 052078. p 2 0 2 2718 362 362 52077: P-VOP (0:36:11.803)
52080: B-VOP (0:36:11.845) 052079. b 3 0 2720 0 12 12 52080: B-VOP (0:36:11.845)
52079: P-VOP (0:36:11.887) 052080. p 2 0 2 2718 362 362 52079: P-VOP (0:36:11.887)
52082: B-VOP (0:36:11.929) 052081. b 3 0 2720 0 11 11 52082: B-VOP (0:36:11.929)
52081: P-VOP (0:36:11.970) 052082. p 2 0 0 2720 360 360 52081: P-VOP (0:36:11.970)
52084: B-VOP (0:36:12.012) 052083. b 3 0 2720 0 16 16 52084: B-VOP (0:36:12.012)
52083: P-VOP (0:36:12.054) 052084. p 2 0 0 2720 383 383 52083: P-VOP (0:36:12.054)
52086: B-VOP (0:36:12.095) 052085. b 3 0 2720 0 11 11 52086: B-VOP (0:36:12.095)
52085: P-VOP (0:36:12.137) 052086. p 2 0 0 2720 360 360 52085: P-VOP (0:36:12.137)
52087: N-VOP (0:36:12.179) 052087. p 2 0 0 2720 7 7 52087: N-VOP (0:36:12.179)
52088: I-VOP (0:36:12.221) 052088. p 2 0 0 2720 7 7 52088: P-VOP (0:36:12.221)
52090: B-VOP (0:36:12.262) 052089. i 2 2720 0 0 7538 7533 52089: I-VOP (0:36:12.262)
52089: P-VOP (0:36:12.304) 052090. b 3 0 2720 0 29 29 52091: B-VOP (0:36:12.304)
52092: B-VOP (0:36:12.346) 052091. p 2 0 80 2640 450 450 52090: P-VOP (0:36:12.346)
52091: P-VOP (0:36:12.387) 052092. b 3 0 2720 0 89 89 52091: P-VOP (0:36:12.387)
As you can see, everything is going along fine, with all three in lockstep, until the n-vop appears.
In the 1st pass avi, the next frame is an I-frame.
In the .pass data file, next frame is another p-Frame.
And the 2nd pass avi, as directed by the 1st pass data file, encodes a P-frame there (where I-frame used to be)
Is this a known bug? I'm using koepi v1.1.0 final.
The problem begins after the one and only N-VOP appears in the first pass AVI file.
Now bear with me, I think my evidence is compelling.
The encodes -
As I said first pass is full quality, and I keep the output avi.
Second pass is sized basically the same as the first pass; from examination of framesize patterns, there isn't any under/over correction going on. That is, no periodic 'higher quant/lower size' or 'lower quant/higher size' frames occur comparing 1st and 2nd pass output files. Thus there shouldn't be any frame size differences (except I-frame boost).
The two png's show drfanalyzer snapshots of the same sequence of frames from the 1st and 2nd pass output files. It's a little difficult to see, but the orange lines immediately preceding the black I-frame lines are significantly larger, even though they are at the same quant. Note that the fourth I-frame, not at a scene boundary, doesn't exhibit this pattern. (Side note: I have requested an enhancement to mpeg4modifier to include frame size so this can be more easily observed).
The only rationale I could come up with for this behaviour was if somehow the first frame of the new scene was being encoded as the final frame of the preceding scene. I investigated and think I found where things seem to go wrong.
What follows is a side by side comparison of the first pass output file and frame lists of both 1st and 2nd pass avis (generated by Mpeg4modifier). I have taken the liberty of adding frame numbers to the .pass file and reordering the mpeg4modifier frame lists into time order to match the .pass file.
1st pass avi file 1st pass out/2nd pass input 2nd pass avi file
51848: I-VOP (0:36:02.212) 051848. i 2 2720 0 0 77089 10591 51848: I-VOP (0:36:02.212)
...
52070: B-VOP (0:36:11.428) 052069. b 3 0 2720 0 11 11 52070: B-VOP (0:36:11.428)
52069: P-VOP (0:36:11.470) 052070. p 2 0 0 2720 360 360 52069: P-VOP (0:36:11.470)
52072: B-VOP (0:36:11.512) 052071. b 3 0 2720 0 16 16 52072: B-VOP (0:36:11.512)
52071: P-VOP (0:36:11.553) 052072. p 2 0 0 2720 383 383 52071: P-VOP (0:36:11.553)
52074: B-VOP (0:36:11.595) 052073. b 3 0 2720 0 11 11 52074: B-VOP (0:36:11.595)
52073: P-VOP (0:36:11.637) 052074. p 2 0 0 2720 360 360 52073: P-VOP (0:36:11.637)
52076: B-VOP (0:36:11.678) 052075. b 3 0 2720 0 11 11 52076: B-VOP (0:36:11.678)
52075: P-VOP (0:36:11.720) 052076. p 2 0 0 2720 360 360 52075: P-VOP (0:36:11.720)
52078: B-VOP (0:36:11.762) 052077. b 3 0 2720 0 12 12 52078: B-VOP (0:36:11.762)
52077: P-VOP (0:36:11.803) 052078. p 2 0 2 2718 362 362 52077: P-VOP (0:36:11.803)
52080: B-VOP (0:36:11.845) 052079. b 3 0 2720 0 12 12 52080: B-VOP (0:36:11.845)
52079: P-VOP (0:36:11.887) 052080. p 2 0 2 2718 362 362 52079: P-VOP (0:36:11.887)
52082: B-VOP (0:36:11.929) 052081. b 3 0 2720 0 11 11 52082: B-VOP (0:36:11.929)
52081: P-VOP (0:36:11.970) 052082. p 2 0 0 2720 360 360 52081: P-VOP (0:36:11.970)
52084: B-VOP (0:36:12.012) 052083. b 3 0 2720 0 16 16 52084: B-VOP (0:36:12.012)
52083: P-VOP (0:36:12.054) 052084. p 2 0 0 2720 383 383 52083: P-VOP (0:36:12.054)
52086: B-VOP (0:36:12.095) 052085. b 3 0 2720 0 11 11 52086: B-VOP (0:36:12.095)
52085: P-VOP (0:36:12.137) 052086. p 2 0 0 2720 360 360 52085: P-VOP (0:36:12.137)
52087: N-VOP (0:36:12.179) 052087. p 2 0 0 2720 7 7 52087: N-VOP (0:36:12.179)
52088: I-VOP (0:36:12.221) 052088. p 2 0 0 2720 7 7 52088: P-VOP (0:36:12.221)
52090: B-VOP (0:36:12.262) 052089. i 2 2720 0 0 7538 7533 52089: I-VOP (0:36:12.262)
52089: P-VOP (0:36:12.304) 052090. b 3 0 2720 0 29 29 52091: B-VOP (0:36:12.304)
52092: B-VOP (0:36:12.346) 052091. p 2 0 80 2640 450 450 52090: P-VOP (0:36:12.346)
52091: P-VOP (0:36:12.387) 052092. b 3 0 2720 0 89 89 52091: P-VOP (0:36:12.387)
As you can see, everything is going along fine, with all three in lockstep, until the n-vop appears.
In the 1st pass avi, the next frame is an I-frame.
In the .pass data file, next frame is another p-Frame.
And the 2nd pass avi, as directed by the 1st pass data file, encodes a P-frame there (where I-frame used to be)
Is this a known bug? I'm using koepi v1.1.0 final.