[MPlayer-dev-eng] [patch][rfc] screenshot

Rich Felker dalias at aerifal.cx
Tue Jul 5 18:50:31 CEST 2005


On Mon, Jul 04, 2005 at 04:19:59AM +0200, Arpi wrote:
> Hi,
> 
> > I needed a screenshot feature, to print frames from a video...
> > so i implemented it. actually first i did RTFA, and found an
> > ugly hack, refused on this list. i tried to do the right way,
> > although i had no time to do whole clean implementation, with
> > support for all colorspaces, filename as parameter etc...
> > do it if you want, and commit if you want. here is it:
> 
> quick TODO:  (after re-reading my patch)
> 
> - check if libpng available (it depends on that)

recommendation: use libavcodec/libavformat instead. :)
and support jpeg too, not just png... (i hate it when people make 500k
png files out of an image that was already jpeg/mpeg-type compressed
to 5k...)

> - check if video available (disable MP_CMD_SCREENSHOT for audio-only)
> - implement more colorspaces, at least RGB24 and RGB32/BGR32
> - implement more formats, jpeg for example
> - remove my debug messages (MSGL_INFO)
> - add error handling for png write
> - remove config(), unneeded
> - let user to pass filename template as filter parameter
>   (and send format-string / buffer overflow advisory to bugtraq:))
> - fix gcc 3.x dependancy (c99-style in-the-wild variable declarations)

definitely!

> - mess up indent :)))
> - send some cola...

:)

one more thing.. this filter saves the _next_ frame decoded, rather
than the current one. this could be useful for some people, but
probably won't for most purposes. it would be nice to also have a
(slow) option to keep a copy of the previous frame and save it when
the command is received. then the filter would work even with
framestep, which is the most common situation for taking screenshots
imo.


rich






More information about the MPlayer-dev-eng mailing list