[MPlayer-dev-eng] best place to analyse uncompressed frames
Arpi
arpi at thot.banki.hu
Wed Apr 24 04:40:33 CEST 2002
Hi,
> I posted earlier about a feature in MPlayer to skip to the next black
> frame (for skipping whole segments of video, commercials for
> instance). I want to give implementing it a try. I was hoping
> somebody could at least point me to the best place in the code to
> start implementing.
>
> Where would be the best place to get the uncompressed/decoded frame
> for color analysis? Ideally, this would be a place common to all
> codecs so that the feature worked equally well no matter the file
> format.
>
> Once I am able to determine when a frame is black (or a near black
> shade of grey) I will try being able to "skip" to a black frame, much
> the same I would think as being able to skip 1 second, or 10 seconds,
>
> Any pointers would be appreciated.
no idea... but it won't be easy.
it would be with old mplayer, but since the video filter layer, the pipeline
connects codec and libvo through filters, and it's independent from player
core. the player (mplayer.c) reads a frame, then call teh video decoder and
done. the video decoder will callback down to the libvo unless framedrop is
set. if i understood your idea right, you want frames to be decoded but not
displayed. what about implementing such filter? vf_skiptoblack.c...
and use control() call to control it from player core.
should be easy, for example:
sh_video->vfilter->control(sh_video->vfilter,VFCTRL_SKIPTOBLACK,&flag);
flag should be set to 1 when user press the 'skip to black' button, and the
filter will reset it to zero if got black frame.
you can tweak decoding loop to skip audio plaback and sleeping while flag==1
note that skipping audio without a-v sync loss is another problem...
A'rpi / Astral & ESP-team
--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
More information about the MPlayer-dev-eng
mailing list