예제 #1
0
 public CapturerBin()
 {
     this.Build();
     captureProps = new CapturePropertiesStruct();
     captureProps.Width = 320;
     captureProps.Height = 240;
     captureProps.VideoBitrate = 1000;
     captureProps.AudioBitrate = 128;
     captureProps.VideoEncoder = VideoEncoderType.H264;
     captureProps.AudioEncoder = AudioEncoderType.Aac;
     captureProps.Muxer = VideoMuxerType.Mp4;
     captureProps.OutputFile = "";
     captureProps.CaptureSourceType = CaptureSourceType.Raw;
     Type = CapturerType.Fake;
 }
예제 #2
0
        public CapturerBin()
        {
            this.Build();
            captureProps = new CapturePropertiesStruct();
            captureProps.Width = 320;
            captureProps.Height = 240;
            captureProps.VideoBitrate = 1000;
            captureProps.AudioBitrate = 128;
            captureProps.VideoEncoder = VideoEncoderType.H264;
            captureProps.AudioEncoder = AudioEncoderType.Aac;
            captureProps.Muxer = VideoMuxerType.Mp4;
            captureProps.OutputFile = "";
            captureProps.CaptureSourceType = CaptureSourceType.System;
            Type = CapturerType.Fake;

            snapshotbutton.Visible = false;
            timelabel.Visible = false;
        }
예제 #3
0
    //Gtk.Window capturerWindow;
    private void cameraRecordInitiate()
    {
        capturer = new CapturerBin();
        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.OutputFile = Util.GetVideoTempFileName();

        s.VideoBitrate =  1000;
        s.CaptureSourceType = CaptureSourceType.Raw;
        s.Width = 360;
        s.Height = 288;

        capturer.CaptureProperties = s;
        capturer.Type = CapturerType.Live;
        capturer.Visible=true;

        //capturerWindow = new Gtk.Window("Capturer");
        //capturerWindow.Add(capturer);
        //capturerWindow.ShowAll();
        //capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose();};
        //hbox_capture.PackStart(capturer, true, true, 0);
        //hbox_capture.ShowAll();

        capturer.Run();
        capturer.ClickRec();
    }
예제 #4
0
파일: person.cs 프로젝트: GNOME/chronojump
    void on_button_take_photo_clicked(object o, EventArgs args)
    {
        List<LongoMatch.Video.Utils.Device> devices = LongoMatch.Video.Utils.Device.ListVideoDevices();
        if(devices.Count == 0) {
            new DialogMessage(Constants.MessageTypes.WARNING, Constants.CameraNotFound);
            return;
        }

        //deactivate camera to allow camera on edit person. videoOn will have same value to light checkbutton again later
        app1_checkbutton_video.Active = false;

        capturer = new CapturerBin();
        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.DeviceID = devices[0].ID;

        s.CaptureSourceType = CaptureSourceType.System;

        capturer.CaptureProperties = s;
        capturer.Type = CapturerType.Snapshot;
        capturer.Visible=true;
        capturer.NewSnapshot += on_snapshot_done;
        capturer.NewSnapshotMini += on_snapshot_mini_done;

        capturerWindow = new Gtk.Window("Capturer");
        capturerWindow.Add(capturer);
        capturerWindow.Modal=true;
        capturerWindow.SetDefaultSize(400,400);

        person_win.Hide();

        capturerWindow.ShowAll();
        capturerWindow.Present();
        capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); };

        capturer.Run();
    }
예제 #5
0
    private void videoCapturePrepare(bool showErrorMessage)
    {
        LogB.Information("videoCapturePPPPPPPPPPPPPPPPPrepare");
        List<LongoMatch.Video.Utils.Device> devices = LongoMatch.Video.Utils.Device.ListVideoDevices();
        if(devices.Count == 0) {
            if(showErrorMessage)
                new DialogMessage(Constants.MessageTypes.WARNING, Constants.CameraNotFound);
            return;
        }

        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.OutputFile = Util.GetVideoTempFileName();

        s.VideoBitrate =  1000;
        s.AudioBitrate =  128;
        s.CaptureSourceType = CaptureSourceType.System;
        s.Width = 360;
        s.Height = 288;

        foreach(LongoMatch.Video.Utils.Device dev in devices){
            LogB.Information(dev.ID.ToString());
            LogB.Information(dev.IDProperty.ToString());
            LogB.Information(dev.DeviceType.ToString());
        }

        s.DeviceID = devices[videoDeviceNum].ID;

        capturer.CaptureProperties = s;

        //checkbutton_video and checkbutton_video_encoder are synchronized
        if(checkbutton_video.Active)
            capturer.Type = CapturerType.Live;
        else
            capturer.Type = CapturerType.Fake;
        capturer.Visible=true;

        try {
            capturer.Stop();
        } catch {}
        capturer.Run();
    }
예제 #6
0
    void on_button_take_photo_clicked(object o, EventArgs args)
    {
        capturer = new CapturerBin();
        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.CaptureSourceType = CaptureSourceType.Raw;

        capturer.CaptureProperties = s;
        capturer.Type = CapturerType.Snapshot;
        capturer.Visible=true;
        capturer.NewSnapshot += on_snapshot_done;
        capturer.NewSnapshotMini += on_snapshot_mini_done;

         		capturerWindow = new Gtk.Window("Capturer");
        capturerWindow.Add(capturer);
        capturerWindow.Modal=true;

        person_win.Hide();

        capturerWindow.ShowAll();
        capturerWindow.Present();
        capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); };
        capturer.Run();
    }