Log in

View Full Version : keyframe(scene change) detection problem


opteron64
9th April 2005, 17:13
Hi, I'm new to this forum.
I did a lot of RMVB editing recently with my 2-pass encoded video and realized a slight problem with keyframe(scene change) detection. The encoder occasionally failed to detect one keyframes(scene changes) when there is a quick sequences of several scene changes. That scene changes are complete and obvious with only a small level of motion within each scene. This keyframe detection failure results in blurrier scene and causes me a lot of trouble on editing since I・ll never be able to split a RMVB at scene change without a keyframe. I have confirmed my results with Media player classic・s :jump (keyframe); function and the .pass file of 1st pass also shows that the encoder failed to insert an :I; frame at certain scene change.
Are there any properties that would affect the sensitivity / threshold of keyframe detection? Or is there a way to improve this problem. PLease help, thx

I have set enableAutoKeyFrames = true.
I・m using the New Curve compression RC with the following video properties in the streams section of the job file:
<avgBitrate type="uint">600000</avgBitrate>
<maxBitrate type="uint">2000000</maxBitrate>
<stream xsi:type="videoStream">
<codecName type="string">rv10</codecName>
<enableLossProtection type="bool">false</enableLossProtection>
<encodingComplexity type="string">low</encodingComplexity>
<encodingType type="string">vbrBitrate</encodingType>
<maxFrameRate type="double">25.000000</maxFrameRate>
<maxKeyFrameInterval type="double">10.000000</maxKeyFrameInterval>
<maxStartupLatency type="double">4.000000</maxStartupLatency>
<pluginName type="string">rn-videocodec-realvideo</pluginName>
<quality type="uint">80</quality>

<codecProperties type="bag">
<firstPassComplexity type="uint">50</firstPassComplexity>
<encoderComplexity type="uint">80</encoderComplexity>
<useThreads type="bool">true</useThreads>
<rcSourceFrameRate type="uint">25000</rcSourceFrameRate>
<chromaModeDecision type="bool">true</chromaModeDecision>
<patternAdaptivity type="uint">2</patternAdaptivity>
<rcPFrameRefQuant type="uint">6</rcPFrameRefQuant>
<rcBFrameRefQuant type="uint">12</rcBFrameRefQuant>
<enableAutoKeyFrames type="bool">true</enableAutoKeyFrames>
<enableRPR type="bool">false</enableRPR>
<rcLowBitrateBoost type="uint">0</rcLowBitrateBoost>
<rcHighBitrateReduce type="uint">0</rcHighBitrateReduce>
<rcKeyFrameBoost type="uint">50</rcKeyFrameBoost>
<rcEnableCurveCompression type="bool">true</rcEnableCurveCompression>
<rcPassNumber type="uint">1</rcPassNumber>
</codecProperties>
</stream>

karl_lillevold
12th April 2005, 17:41
No, unfortunately, the keyframe sensitivity threshold is not exposed. With the lack of editing tools for RM files, not many have needed to tune this before. I'll put it on my list of things to work on for the next update.

With the new RC, there is also a mechanism in the encoder to prevent keyframes from being too close (less than ~10 frames apart). This is to improve the RC accuracy. You could try the old RC and see if you get more key frames inserted with this.

opteron64
12th April 2005, 21:53
I have tested with different values of "patternAdaptivity" and got some interesting results. The keyframes are at least 25 frames apart so it wouldn't be the ~10 frames limit that causes the problem.


Expected keyframes (1 min test clip):
(k=keyframe, x= Undetected keyframe)
k..k..k...k...k.....k...k...k.....k.....k....k..

patternAdaptivity=1,2:
Failed to detect 3 keyframes
k..x..k...x...k.....k...x...k.....k.....k....k..

patternAdaptivity=3:
managed to detect one of the missing keyframes above but in exchange it failed to detect 1 other keyframes.
k..x..k...x...k.....k...k...x.....k.....k....k..

patternAdaptivity=0:
detects 2 keyframes that both cases above failed to detect but still failed to detect 2 keyframes.
k..k..k...k...k.....k...x...k.....k.....k....x..

I also found that "maxConsecutiveBFrames" have similar effects.
It seems to be B-frames that affects the accuracy of keyframes detection.

karl_lillevold
12th April 2005, 22:30
Ah, you found the error in my previous post. It should have read key frames are spaced at least ~8-10 P-frames apart. You could also try without the curve compression rate control..