~rick-rickspencer3/+junk/webcam

« back to all changes in this revision

Viewing changes to gstreamer_webcam/web_cam_box.py

  • Committer: Rick Spencer
  • Date: 2010-08-18 03:49:42 UTC
  • Revision ID: rick.spencer@canonical.com-20100818034942-u7pg232pta010hqk
modified pipeline to save video to file

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
gettext.textdomain('gstreamer-webcam')
26
26
 
27
27
class WebCamBox(gtk.VBox):
28
 
    _default_pipeline_string = """v4l2src !
29
 
                                  videorate ! 
30
 
                                  video/x-raw-yuv,framerate=%i/1 !
31
 
                                  autovideosink """
 
28
    _default_pipeline_string = """
 
29
v4l2src ! videorate ! video/x-raw-yuv,framerate=30/1 ! 
 
30
tee name=t_vid ! queue ! videorate ! video/x-raw-yuv,framerate=30/1 ! autovideosink t_vid. !
 
31
queue ! videorate ! video/x-raw-yuv,framerate=30/1 !  queue ! avimux ! filesink location=boo.avi
 
32
 
 
33
                                  """
32
34
 
33
35
    def __init__(self):
34
36
        gtk.VBox.__init__(self, False, 5)
37
39
        self.pack_start(self.video_window, True, True)
38
40
        self.video_window.show()
39
41
        self._video_frame_rate = 5
40
 
        self._pipline_string = self._default_pipeline_string % self._video_frame_rate
 
42
        self._pipline_string = self._default_pipeline_string #% self._video_frame_rate
41
43
        self.player = None
42
44
        self.connect("destroy", self.on_destroy)
43
45
 
47
49
 
48
50
    @video_frame_rate.setter
49
51
    def video_frame_rate(self, fps):
50
 
        self._pipline_string = self._default_pipeline_string % fps
 
52
        self._pipline_string = self._default_pipeline_string #% fps
51
53
        self.stop()
52
54
        self._set_pipeline()
53
55