Getting EOS while doing a reverse playback with seek event with gstreamer-1.2.4
Amit Pandya
amit4gst at gmail.com
Wed May 20 03:17:36 PDT 2015
Hi,
I'm trying reverse video playback using "seek event" with h264 encoded .mp4
stream on gstreamer-1.2.4 on ubuntu 14.04 desktop.
H264 compressed video was encoded with "iframeinterval=1" in mp4 container.
Following is the gst-launch-1.0 reference pipeline.
gst-launch-1.0 -r filesrc location=720x480_ifi_1.mp4 ! qtdemux ! queue !
h264parse ! avdec_h264 ! xvimagesink -e
Pipeline hits EOS just after sending following seek event & execution ends
prematurely (less than one second)
gst_event_new_seek((-1.0), GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_SKIP,
GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, G_MAXUINT64);
NOTE:
1) If use stop position (n*GST_SECOND) instead of G_MAXUINT64 stills
observed the same EOS issue.
2) Also,tried with .mkv container instead (same h264 stream) &
gst_element_send_event() fails with return FALSE.
To simplify testing, I modified tools/gst-launch.c from gstreamer1.0-1.2.4,
to provide the necessary seek event for reverse playback:
878a879,903
> static void
> send_reverse_event (void)
> {
> GstEvent *seek_event;
> GstStateChangeReturn state;
>
> /* Create event to reverse from max possible position to start */
> seek_event = gst_event_new_seek((-1.0), GST_FORMAT_TIME,
> GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_SKIP,
> GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_SET, G_MAXUINT64);
>
> if (!gst_element_send_event(pipeline, seek_event))
> {
> g_printerr (_("WARNING: Cannot set reverse.\n"));
> return;
> }
>
> /* Wait for pipeline state change */
> state = gst_element_get_state(pipeline, NULL, NULL, GST_SECOND);
> if ((state != GST_STATE_CHANGE_SUCCESS) && (state !=
> GST_STATE_CHANGE_ASYNC))
> {
> g_printerr(_("WARNING: Unsuccessful state change for reverse\n"));
> }
> }
>
885a911
> gboolean reverse = FALSE;
908a935,936
> {"reverse", 'r', 0, G_OPTION_ARG_NONE, &reverse,
> N_("Play source in reverse, if supported"), NULL},
1064a1093,1098
>
> if (reverse)
> {
> PRINT (_("Reverse selected.\n"));
> send_reverse_event();
> }
Also, tried with the attached sample test app & observed the same issue.
Let me know in case it's already known issue or already have a fix
available.
seek_testapp.c
<http://gstreamer-devel.966125.n4.nabble.com/file/n4671929/seek_testapp.c>
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Getting-EOS-while-doing-a-reverse-playback-with-seek-event-with-gstreamer-1-2-4-tp4671929.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list