New imagesequencesrc element
Submitted by César Fabián Orccón Chipana
Assigned to Tim Müller @tpm
Link to original bug (#731890)
Description
Created attachment 278728
It is an example of how to use GstImageSequenceSrc
Hello guys. I've written an element in gst-plugins-bad which I called as GstImageSequenceSrc. It works very similar to GstMultiFileSrc, but there are some differences.
Differences with GstMultiFileSrc.
-
Handles a list of filenames instead of a printf pattern as GstMultiFileSrc does.
- Having a list of filenames is useful because you can set the filenames you want,
in the order you want. For example, you can add more filenames or sort the list. - There are two ways to create this list:
a) Setting a location propertie. This value could look like:
1) "/some/folder/with/images/ or ."
2) "/a/path/img.jpg,/other/path/img2.jpg" or "img1.png,img2.png"
3) "/a/path/.JPEG" or ".png"
b) Setting the filename-list (GList) directly.
- Having a list of filenames is useful because you can set the filenames you want,
-
Creates an "imagesequence://" protocol which allows the playbin to play this element. It handles a 'fake' uri but it is useful finally.
gst-launch-1.0 playbin uri="imagesequencesrc:///some/path/*.jpg?framerate=20/1&loop=1" -
It "detects" the mimetype of the images. You only have to worry about the framerate.
-
It calculates the duration.
Things to improve:
- Seeking: it seeks to the wrong image sometimes (actually, after many seeks).
- The way duration is calculated.
PD: stormer was telling me to support png and jpeg files (both at the same time) but I don't see a usecase.
You can see the most-stable version of this element in
https://github.com/cfoch/gst-plugins-bad/tree/sequences/gst/sequences
Develop:
https://github.com/cfoch/gst-plugins-bad/tree/sequences-develop/gst/sequences
Attachment 278728, "It is an example of how to use GstImageSequenceSrc":
test.c