gnonlin gnlurisource combine videos
Nicolas Dufresne
nicolas.dufresne at collabora.com
Thu Oct 31 13:27:46 CET 2013
Le mercredi 30 octobre 2013 à 20:08 -0700, troywang a écrit :
> why is gnonlin-1.1.90's gnlfilesource missing? And thus how to use gnonlin to
> combine some mp4 files? I have to use gnlurisource ?
Yes.
> GObject.threads_init()
That is not needed anymore.
> Gst.init(None)
>
> class Main:
> def __init__(self):
> # creating the pipeline
> self.pipeline = Gst.Pipeline()
> self.bus = self.pipeline.get_bus()
> self.bus.add_signal_watch()
> self.bus.connect('message::eos',self.on_eos)
> # creating a gnlcomposition
> self.comp = Gst.ElementFactory.make("gnlcomposition",
> "mycomposition")
> self.pipeline.add(self.comp)
> self.comp.connect("pad-added", self.OnPad)
>
>
> # create a filesink
> self.filesink = Gst.ElementFactory.make('filesink',
> 'filesink')
> self.filesink.set_property('location','test.mp4')
> self.pipeline.add(self.filesink)
When using GNL, you can't have non-gnl based sources.
>
>
> # create a gnlurisource
> self.video1 = Gst.ElementFactory.make("gnlurisource", "aaa")
> self.comp.add(self.video1)
>
> # set the gnlurisource properties
> self.video1.set_property("uri", "aaa.mp4")
This is not a valid URI. A file base URI should look like
"file:///home/test/aaa.mp4".
> self.video1.set_property("start", 0 * Gst.SECOND*0)
> self.video1.set_property("duration", 5 * Gst.SECOND)
It's a good habit to also set the inpoint and priority.
>
> # create a gnlurisource
> self.video2 = Gst.ElementFactory.make("gnlurisource", "bbb")
> self.comp.add(self.video2)
>
> # set the gnlurisource properties
> self.video2.set_property("uri", "bbb.mp4")
See previous comment.
> self.video2.set_property("start", 0 * Gst.SECOND*1)
> self.video2.set_property("duration", 5 * Gst.SECOND)
> self.pipeline.set_state(Gst.State.PLAYING)
In newer version of GNL you need to emit the "commit" action in order
for you changes to take effect, but I think we wanted the initial commit
to be automatic, I'll check with the others.
Hoping this information will help.
Nicolas
More information about the gstreamer-devel
mailing list