Play a file while downloading it (appending new data to it)

Florin Curelaru patronixys at yahoo.com
Thu Oct 13 12:33:02 PDT 2011


   Hi guys,

 I'm trying to find a simple solution for playing a local file that is
updated from time to time (by appending new data).

 The problem appears when using standard source elements (let's say filesrc)
as the duration of the file is not updated after having finished the first
preroll process of the pipeline. That will cause a premature generation of
an EOS message when the current position reaches the initial size of the
file, even though the file was update many times meanwhile. There are some
exceptions for some pipeline configurations, especially when no seek was
requested and the file continues playing till the end of the updated file,
but I'm not interested in them as the duration doesn't follow accurately the
updates of the file.

 I tried first time to use the gnfilesource as source element (from gnolin
library) which allows to set a total duration as desired. It works very well
with some codecs, but crashes on hardware for any mp3 file when using in
conjunction with the nv_omx_mp3dec.
 By using gst-launch the pipeline looks similar to:

 gst-launch gnlfilesource location=path_to_mp3_file start=0
duration=20000000000 ! mp3parse ! nv_omx_mp3dec ! alsasink

 and  a segmentation fault is encountered after a seek event rposted by the
gnl object. When using filescr instead of gnlfilesource the song is played,
but till the end of initial size.


 I tried also to post a message_new_duration (with a specific value for
duration) in order to update the pipeline internal variable for duration,
but on the pipeline's bus appears the message (GST_MESSAGE_DURATION) with
the initial duration of the file.


 So, I'm looking for a simple solution to play and seek into a file that is
downloaded on the fly. I think that an approach based on a source plugin is
not an easy task as long as nv_omx_mp3dec causes unexpected crashes in
ordinary situations.

Thank you in advance,
Florin

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Play-a-file-while-downloading-it-appending-new-data-to-it-tp3902651p3902651.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list