jpegenc a theora playbin2 buffer?

Erik Blankinship jedierikb at gmail.com
Mon Sep 19 06:38:54 PDT 2011


I am trying to convert a playbin2 ogv theora buffer to a jpeg encoded buffer
through an appsrc ! ... ! appsink pipeline.

I am taking my cue from the approach described here [1].

The simple code below works... but the  appsrc ! appsink pipeline is
obviously *not *right -- the resultant buffer is not jpegencoded.

If I try to expand my pipeline to  appsrc ! ffmpegcolorspace ! jpegenc !
appsink the app hangs.  I've tried inserting a theoradec in there too, but
that doesn't seem necessary as the buffer from the playbin2 should be
decoded.

    def get_last_frame_as_pixbuf( self ):
        last_frame = self.playbin2.get_property( "frame" )
        if last_frame is None:
            return None

        frame_grab_line = gst.parse_launch( "appsrc name=src ! appsink
name=sink" )
                          # this hangs... --> "appsrc ! ffmpegcolorspace !
jpegenc ! appsink"
        frame_src = frame_grab_line.get_by_name( 'src' )
        frame_sink = frame_grab_line.get_by_name( 'sink' )

        frame_grab_line.set_state( gst.STATE_PAUSED )
        frame_src.emit( "push-buffer", last_frame )

        print( "about to grab" )
        buf = frame_sink.emit('pull-preroll')
        print( "grabbed(!):", buf )
        pic = gtk.gdk.pixbuf_loader_new_with_mime_type("image/jpeg")
        loader.write(buffer)
        loader.close()
        return loader.get_pixbuf()

[1]
http://lists.freedesktop.org/archives/gstreamer-devel/2009-December/024770.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110919/9c686500/attachment.htm>


More information about the gstreamer-devel mailing list