Discussion:
Rewind in filesrc
Baby Octopus
2013-01-24 08:22:04 UTC
Permalink
Is there any way to rewind(seek a file to the beginning) in filesrc? I want
only this element to be seeked and not the complete pipeline.

Ideally I would expect it to be a property of filesrc element, which if set,
will rewind once if EOF is reached.

Since I would need this feature for continuous playback, I will add this
feature if no such thing exists as of now. Anybody with any info on this?

~BO



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Rewind-in-filesrc-tp4658131.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
Tim-Philipp Müller
2013-01-24 09:21:11 UTC
Permalink
Post by Baby Octopus
Is there any way to rewind(seek a file to the beginning) in filesrc? I want
only this element to be seeked and not the complete pipeline.
Ideally I would expect it to be a property of filesrc element, which if set,
will rewind once if EOF is reached.
Since I would need this feature for continuous playback, I will add this
feature if no such thing exists as of now. Anybody with any info on this?
What are you trying to do exactly? For looping you can use segment seeks
and seek back to time 0 when you get the segment-done message.

Cheers
-Tim
Baby Octopus
2013-01-24 09:55:04 UTC
Permalink
I want to test my video encoder which takes in raw YUV from the file, for a
long duration. My YUV file has only 600 frames, but I want to test it for
say 100,000 frames. Resetting the pipeline will reset all the elements which
I dont want. I want only the filesrc to get reset

My pipeline is as follows

gst-launch filesrc location=/mnt/test/yuv/foreman.yuv ! videoparse width=720
height=480 ! mp2_encoder bitrate=1024000 ! filesink
location=/mnt/test/stream/foreman_ntsc.mpeg2

~BO



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Rewind-in-filesrc-tp4658131p4658139.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
Tim-Philipp Müller
2013-01-24 10:11:02 UTC
Permalink
Post by Baby Octopus
I want to test my video encoder which takes in raw YUV from the file, for a
long duration. My YUV file has only 600 frames, but I want to test it for
say 100,000 frames. Resetting the pipeline will reset all the elements which
I dont want. I want only the filesrc to get reset
My pipeline is as follows
gst-launch filesrc location=/mnt/test/yuv/foreman.yuv ! videoparse width=720
height=480 ! mp2_encoder bitrate=1024000 ! filesink
location=/mnt/test/stream/foreman_ntsc.mpeg2
Depending on how large the file is and how much RAM you have, you could
just use multifilesrc (it will allocate one buffer for the whole file
then each time it pushes it). Alternatively, you could do something with
hardlinks and use splitfilesrc. Or just try

cat file file file file file | gst-launch fdsrc ! ...

Cheers
-Tim
Baby Octopus
2013-01-24 12:58:27 UTC
Permalink
Perfect. multifilesrc works like a charm. When loop=1 it does exactly what I
want

Only thing is I'm unable to run the following pipeline in loop

gst-launch multifilesrc location="/mnt/test/youtube/apple_1.mp4" loop=1 !
decodebin ! mp2_encoder ! filesink location=/mnt/test/multiout.mpeg2

This is due to the fact that *mp4* and *flv* returns *EOS* which terminates
the pipeline. Ofcourse this has nothing do with multifilesrc element

Thanks Tim for the help

~BO




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Rewind-in-filesrc-tp4658131p4658143.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
Olivier Crête
2013-01-24 17:33:08 UTC
Permalink
Post by Baby Octopus
Perfect. multifilesrc works like a charm. When loop=1 it does exactly what I
want
Only thing is I'm unable to run the following pipeline in loop
gst-launch multifilesrc location="/mnt/test/youtube/apple_1.mp4" loop=1 !
decodebin ! mp2_encoder ! filesink location=/mnt/test/multiout.mpeg2
This is due to the fact that *mp4* and *flv* returns *EOS* which terminates
the pipeline. Ofcourse this has nothing do with multifilesrc element
Put a pad probe and drop the EOS event ?
--
Olivier Crête
***@collabora.com
Tim-Philipp Müller
2013-01-24 17:47:22 UTC
Permalink
Post by Olivier Crête
Post by Baby Octopus
Perfect. multifilesrc works like a charm. When loop=1 it does exactly what I
want
Only thing is I'm unable to run the following pipeline in loop
gst-launch multifilesrc location="/mnt/test/youtube/apple_1.mp4" loop=1 !
decodebin ! mp2_encoder ! filesink location=/mnt/test/multiout.mpeg2
This is due to the fact that *mp4* and *flv* returns *EOS* which terminates
the pipeline. Ofcourse this has nothing do with multifilesrc element
Put a pad probe and drop the EOS event ?
I don't think the demuxer will be able to deal with this ..

Cheers
-Tim
Baby Octopus
2013-01-24 18:45:06 UTC
Permalink
Olivier, what exactly you mean by pad probe?

~Bo



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Rewind-in-filesrc-tp4658131p4658147.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
Loading...