I am writing a video player. My application uses playbin2.
It constructs the following pipeline:
player.png.
As can be seen from the pipeline, it uses Fluendo MPEG PS demuxer from gst-plugins-bad.
I am trying to implement the "Go end" command, which would position the player to the last frame.
The problem is that that last frame is not displayed, neither in paused, nor in playing state.
I perform this command in the following way
gboolean rb=gst_element_seek_simple(GST_ELEMENT(m_player),
GST_FORMAT_TIME,
(GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
m_stream_duration);
I tried different combinations of flags, also with _KEY_UNIT, tried subtracting a small amount of time from
m_stream_duration (40ms) - nothing helps.
The sound from the headphones suggests, that the pipeline has positioned to the end of file, but the last frame is not displayed.
But, this simple seeking to the end of file perfectly worked for OGG files.
I was studying the details of the video-sink and MPEG-2 demuxing and decoding plugins for already two weeks. From what I've studied, it can be seen, that when the seek issued, the mpeg2 demuxer processes some data and gives them further, mpeg2dec also tries decoding something but seems to drop frames. Videosink simply doesn't receive a video buffer.
I've also tried to set up a backward playing from the end of file:
gst_element_seek(GST_ELEMENT(m_player),-1.0,
GST_FORMAT_TIME,(GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_SET,0,GST_SEEK_TYPE_END,0);
This helped for that particular file, but didn't work for another one.
Please, help me to make the playbin2 to display the last frame of any MPEG file.