In Gstreamer's core reference library there is a function
gst_element_seek.It is said that if the parameter rate of the function
gst_element_seek is set to -1.0 reverse playback can be implemented.I
tried this for playing a MP4 file but reverse playback could not be
achieved...Could you give me a suggestion of how to achieve reverse
playback....
if(pipeline){
g_print("playback....\n");
GstFormat fmt = GST_FORMAT_TIME;
gint64 pos;
gint64 length;
if(pipeline && gst_element_query_duration(pipeline, &fmt, &length) && gst_element_query_position(pipeline,&fmt,&pos))
{
rate = -1.0;
if(gst_element_seek(pipeline,rate,GST_FORMAT_TIME,(GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_KEY_UNIT|GST_SEEK_FLAG_SKIP),GST_SEEK_TYPE_SET,0,GST_SEEK_TYPE_SET,pos))
{
GstState state;
gst_element_get_state(pipeline,&state,NULL,-1);
if(state != GST_STATE_PLAYING)
gst_element_set_state(pipeline,GST_STATE_PLAYING);
}
}
}
It is can not reverse playback of H264 encoding the MP4 video , but It will can reverse playback of mepg-4 encoding the MP4 video ,such as the mpeg-4 encodeing of the mp4/avi video
Could you give me a suggestion?
thanks !
email: 623669584@qq.com
你还是你,我还是我.....