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 |
On 10/13/2011 09:33 PM, Florin Curelaru wrote:
> 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). This has been discussed a few times before on the list. It won't work out of the box with the current filesrc element. The file-src element would need to be aware that the size is changing and e.g. on every read, check the size and if changed send a new duration message downstream. Stefan > 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. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi Stefan,
Very interesting! I'm working also on that. Do you have any example c-code for a solution? BG Bernhard Gesendet mit BlackBerry von Vodafone -----Original Message----- From: Stefan Sauer <[hidden email]> Sender: gstreamer-devel-bounces+bernhard.graaf=[hidden email] Date: Fri, 14 Oct 2011 09:26:28 To: <[hidden email]> Reply-To: Discussion of the development of and with GStreamer <[hidden email]> Subject: Re: Play a file while downloading it (appending new data to it) On 10/13/2011 09:33 PM, Florin Curelaru wrote: > 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). This has been discussed a few times before on the list. It won't work out of the box with the current filesrc element. The file-src element would need to be aware that the size is changing and e.g. on every read, check the size and if changed send a new duration message downstream. Stefan > 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. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |