[MPlayer-dev-eng] Screenshot Filter

ObsessiveMathsFreak obsessivemathsfreak at eircom.net
Sun Aug 28 01:21:19 CEST 2005


> I have totally lost the track of what you actually want to achieve, but
> would a screenshot filter having no cpu requirements when idle,
> accepting all the colorspaces that vf_scale accepts and rescaling to a
> correct aspect ratio please you?

Yes, that was rather beautiful, thank you. Plus this one doesn't need to 
be wrapped around scale filters. Kudos to you!


I did a small amount of experimenting with dynamically inserting the 
screenshot filter. It turns out it can be done if you call 
mpcodecs_config_vo after the filter is inserted, like so:

vf_instance_t *vfilterlist = (vf_instance_t*)sh_video->vfilter;
vf_instance_t *new_filter = vf_add_before_vo(&vfilterlist , 
"screenshot", NULL);

sh_video->vfilter = vfilterlist;

//reconfigure codecs
mpcodecs_config_vo (sh_video, sh_video->disp_w,sh_video->disp_h, 0);


But there are problems.(Apart from the calamitous uglyness of this hack!)

If you insert the new filter as the first in the filter chain, then 
something will go awry and ugly black squares will pop up(on xvid files 
at least).(not sure what the technical term for this is, "codec 
hiccup"?). If however, you insert the filter anywhere else, such as 
before vo using vf_add_before_vo, then no problems seem to occur and yo 
can start snapping screenshots with seemingly no ill effects.

Naturally, if there are no other filters apart from vo in the filter 
chain, you'll get nasty black squares no matter what you do, because the 
filter is always added as the first.

This actually occurs regardless of the new filter you insert. It can be 
"screenshot," "scale", "cropdetect" , whatever. If it's set as the first 
filter in the chain, you get errors. The errors go away as soon as you 
go further on (keyframe?), so mplayer is still usable after insertion.

These errors seem to happen for almost every vo filter, even for -vo 
null !! They come up on the screenshots as well. Strangely,they don't 
seem to appear for -vo png ? So it "seems".

I could spend eternity trying to sort this OR I could just add alias 
mplayer="mplayer -vf screenshot" to my .bashrc. I think for now I'll go 
with the second option.

Thanks for the patch. It works like a dream. And apologies if I was too 
great an irritation.




More information about the MPlayer-dev-eng mailing list