[FFmpeg-devel] [RFC] scenechange_score in AVCodecContext?

Stefano Sabatini stefano.sabatini-lala
Tue Nov 20 10:09:04 CET 2007


On date Monday 2007-11-19 19:08:46 +0100, Michael Niedermayer encoded:
> On Mon, Nov 19, 2007 at 05:35:22PM +0100, Stefano Sabatini wrote:
[...]
> > BTW, I tested the behaviour with a silent video, obtaining these weird
> > results:
> > 
> > ./ffmpeg -i silence.mpeg -s ${size}x${size} -vstats_file vstats -r 30 -y test.avi; less vstats
> > 
> > size                 average_P_frame_scenechage_score
> > 8                    -7
> > 16                   -7
> > 32                   -28
> > 64                   16
> > 128                  -448
> > 256                  256
> > 512                  ~-3020
> > 
> > When encoding with size 64 and 256 and with the default value of
> > scenechange_score_threshould every frame is encoded as an I-frame. Is
> > this to a be considered a bug?
> 
> you would have to provide complete information so we can reproduce it
> before i can awnser that

Apply the patch to ffmpeg (or simply monitor the scenechange_score
variable in libavcodec/mpegenc_video.c), then try this:

ffmpeg -t 5 -f rawvideo -s 176x144 -pix_fmt rgb24 -r 30 \
       -i /dev/zero -s 256x256 -vstats_file vstats -y test.avi; \
and less vstats

I varied the width value of the input video frames from 176 to 210
step 2, getting in most cases positive scenechange_score values (128
or 256), resulting in I-frame only sequences, with the exceptions of the
values of 180, 190 and 204, in these cases I get negative values.

This behaviour also seems to depend on the size of the output frames,
in particular it seems to misbehaves with a size of 256 and of 64.

Best regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)




More information about the ffmpeg-devel mailing list