frame-by-frame and reverse playback in python

RiccardoCagnasso riccardo at phascode.org
Mon Jun 24 21:33:58 UTC 2019


I'm trying to incorporate frame-by-frame playback a playbin based python
software, following this documentation
https://gstreamer.freedesktop.org/documentation/tutorials/basic/playback-speed.html?gi-language=c

I encountered some problems. First if I try to do 

        self.pipeline.send_event(Gst.Event.new_seek(0.0, Gst.Format.TIME,
Gst.SeekFlags.FLUSH, Gst.SeekType.SET, position, Gst.SeekType.NONE, 0))
  
and then

    self.pipeline.send_event(Gst.Event.new_step(Gst.Format.BUFFERS, 1, 1,
True, False))

It doesn't work, the video just freezes. But it starts to work perfectly if
i change the seek to

        self.pipeline.send_event(Gst.Event.new_seek(0.00000001,
Gst.Format.TIME, Gst.SeekFlags.FLUSH, Gst.SeekType.SET, position,
Gst.SeekType.NONE, 0))

This seems to me some type conversion problem. But I don't have the
expertise on GI/Gobject/C to track it down.

More important, I can't seem to get reverse playback working.

            pos = self.player.pipeline.query_position(Gst.Format.TIME)[1]
           self.pipeline.send_event(Gst.Event.new_seek(-1.0,
Gst.Format.TIME, Gst.SeekFlags.FLUSH, Gst.SeekType.SET, 0,
Gst.SeekType.NONE, pos))

This should work, but the video just freezes and i get this error message:

0:00:20.992670044  6144 0x7f6f380165e0 WARN            videodecoder
gstvideodecoder.c:1140:gst_video_decoder_sink_event_default:<avdec_huffyuv0>
error: No valid frames decoded before end of stream
0:00:20.992697014  6144 0x7f6f380165e0 WARN            videodecoder
gstvideodecoder.c:1140:gst_video_decoder_sink_event_default:<avdec_huffyuv0>
error: no valid frames found









--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list