[MPlayer-dev-eng] [PATCH] New slave command for loading video filters at runtime

Jehan Pagès jehan.marmottard at gmail.com
Sat Apr 3 19:38:39 CEST 2010


Hi,

as I have sent a patch for loading audio filters at runtime, I thought
I might check if I could not do the same for video filters (though I
don't have personally any use for such a feature, at the contrary of
audio filters that I use a lot more now that I could bind key to load
them) but I think some people find this interesting.

I only made one single command this time:

# mplayer -input cmdlist |grep vf
vf_add               String

Symetrically to af_add, vf_add loads any list of video filters,
comma-separated, with arguments optionaly, so basically the same
format again as using -vf from command line.

For instance the slave command "vf_add rectangle=300:100:5:10,flip"
during runtime will flip the image and draw a rectangle on the display
with the given coordinates. This is the same as the command line
"mplayer <movie> -vf rectangle=300:100:5:10,flip" except that you can
do this in the middle of the media file without stopping the playback.

Why I didn't do any vf_del is that I didn't find how to do so and that
I spent at least 2 hours on this simple patch (which is more than the
cumulated time for the 3 other patches I am sending... yeah I have
still 2 to send).

Implementation note: it works rather well but I did not find how to
"refresh" the display immediately after loading the video filter.
Hence there was a short time (often like one second, sometimes a
little more, sometimes the change is immediate and nice...) when the
image is crappy. The workaround I found after asking for advice on the
irc channel is to seek at the current position. Unfortunately this
solution (this is the one implemented in the current attached patch)
has the drawback that seeking seems really inaccurate. Hence as a
consequence there is a small time leap when you load a video filter.
Is seeking in a video necessarily that bad? Is there something I don't
do right to seek (cf. my code where I seek at a relative time of 0
second!)?
I am nearly thinking that maybe getting a bad image for a second but
at least keeping a smooth playback might be better.

So would you have a fix for this? How can I otherwise force a display
refresh immediately after loading the new filters and keeping a smooth
playback?
Thanks. Current version of the patch attached.

Jehan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_vf_filters.patch
Type: text/x-patch
Size: 3550 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100404/077709be/attachment.bin>


More information about the MPlayer-dev-eng mailing list