[gst-devel] output x session to multiple files

Zaheer Merali zaheerabbas at merali.org
Fri Jul 28 16:38:31 CEST 2006


On 7/27/06, Shlomi Israel <sijproject at gmail.com> wrote:
> Hi,
>
> I really hope this is the right place to ask.
>
> I know I can record the screen to a theora video, and as I understand
> to any other format gstreamer supports. What I need is to capture the
> screen and save each session in a different file as a PNG or Jpeg.
>
> technically, what I looked for is a smart way to capture the screen. I
> saw ximagesrc uses XDamage if it's available, which is exactly what I
> am looking for. I read a similar thread, that suggested using a loop,
> but as much as I understand it will not be as efficient as I want, I
> want it to capture the screen only when it is needed (using XDamage)
> but instead saving it as a video, I want it to be saved as multiple
> image files.
>
> I read it is possible using gstreamer 0.8 using multifilesink and pngenc.
> but on gstreamer 0.10 multifilesink doesn't work, and pngenc has no
> `newmedia` property
>
> I tried the following:
> gst-launch-0.10 ximagesrc ! ffmpegcolorspace ! theoraenc ! oggmux !
> filesink location=target.ogg
> and then:
> gst-launch-0.8 filesrc location=target.ogg ! oggdemux ! theoradec !
> ffmpegcolorspace ! pngenc snapshot=false newmedia=true ! multifilesink
> location=image%02d.png
>

Correct, in 0.8 there are new media events.  In 0.10, there is nothing similar.

> Which seems to work well (though the images were too orange).
> This method has too many problems: I use both 0.8 and 0.10 (I need
> multifilesink and newmedia=true), I encode to theora and it probably
> reduces the efficiency and last but not least, the quality of the PNGs
> is very low :(.

pngenc has a quality setting, and i believe can encode losslessly too.
 However I think there was an issue in an earlier gst 0.8 version
whereby pngenc had incorrect caps which could cause the orange issue.


>
> Any idea on how to implement this in a smarter way?
>
> Thanks in advanced,
> Shlomi

Have a look at istanbul and how it is coded.  I do plan on supporting
multi-file image captures in the future.  Maybe you can help with a
patch.  It can be done for example in python by creating a sink that
puts every buffer in a file.

Take Care

Zaheer




More information about the gstreamer-devel mailing list