d789548488c0d13c575a7a434c9ea1cad2717306
1 #!/usr/bin/env python3.4
3 from gi
.repository
import Gst
6 def constructpipeline (self
):
9 """Add and link elements in a GStreamer pipeline"""
11 # Create the pipelines instance.
12 self
.streampipe
= Gst
.Pipeline()
13 self
.storepipe_hi
= Gst
.Pipeline()
14 self
.storepipe_lo
= Gst
.Pipeline()
16 # Define pipeline elements.
17 ## The next line will NOT display the camera's video feed
18 ## self.videosrc = Gst.ElementFactory.make('location', 'rtsp://192.168.48.2:554')
19 self
.videosrc
= Gst
.ElementFactory
.make('videotestsrc', 'source')
21 self
.queue
= Gst
.ElementFactory
.make('queue')
23 ## self.oggstreamsink = Gst.ElementFactory.make()
24 ## self.oggdisksink = Gst.ElementFactory.make()
26 ## self.jpegdisksink = Gst.ElementFactory.make()
28 self
.screensink
= Gst
.ElementFactory
.make('sink', 'xvimagesink')
30 ## self.webmdisksink = Gst.ElementFactory.make()
31 ## self.webmstreamsink = Gst.ElementFactory.make()
33 # Add the elements to the pipeline.
34 self
.streampipe
.add(self
.videosrc
,
38 # Link the elements in the pipeline.
41 streampipe
.set_state(Gst
.State
.PLAYING
)