<div><font face="arial, helvetica, sans-serif"><span style="font-family:arial"><font face="arial, helvetica, sans-serif">I am trying to convert a playbin2 ogv theora buffer to a jpeg encoded buffer through an </font><font face="'courier new', monospace" style="background-color:rgb(204, 204, 204)">appsrc ! ... ! appsink</font><font face="arial, helvetica, sans-serif"> pipeline.</font></span></font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div>
<div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; ">I am taking my cue from the approach described here [1].</span></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="font-family:arial, helvetica, sans-serif">The simple code below works... but the </span><font face="arial, helvetica, sans-serif"> </font><font face="'courier new', monospace" style="background-color:rgb(204, 204, 204)">appsrc ! appsink</font><font face="arial, helvetica, sans-serif"> pipeline is obviously <b>not </b>right -- the resultant buffer is not jpegencoded.</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">If I try to expand my pipeline to </font><font face="arial, helvetica, sans-serif"> </font><font face="'courier new', monospace" style="background-color:rgb(204, 204, 204)">appsrc ! ffmpegcolorspace ! jpegenc ! appsink</font><span style="font-family:arial, helvetica, sans-serif"> 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.</span></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> def get_last_frame_as_pixbuf( self ):</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> last_frame = self.playbin2.get_property( "frame" )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> if last_frame is None:</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> return None</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"><br></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> frame_grab_line = gst.parse_launch( "appsrc name=src ! appsink name=sink" )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> # this hangs... --> "appsrc ! ffmpegcolorspace ! jpegenc ! appsink"</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> frame_src = frame_grab_line.get_by_name( 'src' )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> frame_sink = frame_grab_line.get_by_name( 'sink' )</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> frame_grab_line.set_state( gst.STATE_PAUSED )</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> frame_src.emit( "push-buffer", last_frame )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> print( "about to grab" )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> buf = frame_sink.emit('pull-preroll')</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> print( "grabbed(!):", buf )</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> pic = gtk.gdk.pixbuf_loader_new_with_mime_type("image/jpeg")</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> loader.write(buffer)</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> loader.close()</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> return loader.get_pixbuf()</font></div></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div>
<div><font face="arial, helvetica, sans-serif">[1] <a href="http://lists.freedesktop.org/archives/gstreamer-devel/2009-December/024770.html" target="_blank">http://lists.freedesktop.org/archives/gstreamer-devel/2009-December/024770.html</a></font></div>