this seek error is confusing and appears to be wrong

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

this seek error is confusing and appears to be wrong

Andres Gonzalez
Hi,

I have a simple pipeline:  filesrc -> decodebin ....... appsink

I am testing with several of the big buck bunny files which all appear to be correctly formatted container files when playing them with various media players and as verified by gst-discoverer. The pipeline works without errors when played normally.

I first put the pipeline in the PAUSED state, then after several seconds I issue this seek command:

    gst_element_seek(pGstPipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
                            GST_SEEK_TYPE_SET, lNewPosition, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)

this fails and produces the following information.  This is my logging output which contains some logging from my routines and the bus messages. The onFileEOS() is the signal handler from the final appsink.

stream duration                                 : 0:09:56.461666666
seeking to position                            : 0:04:58.230833333
onFileEOS(): entered
ERROR: GstBus msg from GstElement                    : qtdemux3        
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux3:
atom .|.. has bogus size 94072701
ERROR: GstBus msg from GstElement                    : FileSrc-4        
ERROR:     : error: Internal data flow error.
ERROR:     : info : gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:FilePipeline-4/GstFileSrc:FileSrc-4:
streaming task paused, reason error (-5)
ERROR: GstBus msg from GstElement                    : qtdemux3        
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux3:
atom .|.. has bogus size 94072701
onFileEOS(): entered
ERROR: GstBus msg from GstElement                    : qtdemux3        
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux3:
atom ..J. has bogus size 2787970170
ERROR: GstBus msg from GstElement                    : FileSrc-4        
ERROR:     : error: Internal data flow error.
ERROR:     : info : gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:FilePipeline-4/GstFileSrc:FileSrc-4:
streaming task paused, reason error (-5)
ERROR: GstBus msg from GstElement                    : qtdemux3        
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux3:
atom ..J. has bogus size 2787970170
ERROR: fileSeek(): gst_element_seek() failed

The confusing part is the invalid file error because the files are indeed correct. Also, after this error the pipeline goes to the PAUSED state with the stream position of 0:00:00.000000000.

Question: why do I get the invalid file error?
Question: why is the appsink posting 2 EOS events?
Question: why is the stream position 0:00:00.000000000 after the EOS event?  should it not be the end of the file or the duration of 0:04:58.230833333?

Thanks,
-Andres
Reply | Threaded
Open this post in threaded view
|

Re: this seek error is confusing and appears to be wrong

Andres Gonzalez
Hi,

I have been trying all sorts of various combinations of enum values in calling gst_element_seek() and still cannot get this to work.

Using the follow to do a seek:

    gst_element_seek_simple(pGstPipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,  5*GST_SECOND);

which fails with the following logs:

ERROR: fileSeek(): gst_element_seek_simple() failed
ERROR: GstBus msg from GstElement                    : qtdemux1
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux1:
atom .... has bogus size 2591581531
ERROR: GstBus msg from GstElement                    : FileSrc-4
ERROR:     : error: Internal data flow error.
ERROR:     : info : gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:FilePipeline-4/GstFileSrc:FileSrc-4:
streaming task paused, reason error (-5)
ERROR: GstBus msg from GstElement                    : qtdemux1
ERROR:     : error: This file is invalid and cannot be played.
ERROR:     : info : qtdemux.c(5814): gst_qtdemux_process_adapter (): /GstPipeline:FilePipeline-4/GstDecodeBin:FileDecodeBin-4/GstQTDemux:qtdemux1:
atom .... has bogus size 2591581531
onVideoAppSinkEOS(): entered

Not sure how much simpler the GStreamer seek API could be so I think if gst_element_seek_simple() fails, then the problem must be in the pipeline.

Question: are there any specific properties in filesrc or decodebin that have to be set so the pipeline will support seeking? The pipeline plays perfectly otherwise so I am not sure what is causing this.

-Andres

 
Reply | Threaded
Open this post in threaded view
|

Re: this seek error is confusing and appears to be wrong

Andres Gonzalez
Hi,

I resolved this problem so I thought I would post how I fixed it.

The filesrc element has a property:
    do-timestamp: Apply current stream time to buffers
    flags: readable, writable
    Boolean. Default: false

I was setting this to true and this was causing the GstBus errors on some files. When I kept the default value of false, the seek routines do not cause bus errors.

I still cannot get the pipeline to seek correctly but that is a problem for tomorrow. :-)
Getting the routines to execute without errors is progress even if its a small step forward.

-Andres