locked
Video record RRS feed

  • Question

  • hi!
    i need to make an application where on button click i will be able to start camera and record video. I am using CameraCaptureDialog() . Everything is working BUT problem is VideoTimeLimit. I need to record a video during one or two minutes and after that automatically stop recording  and save video. But when i write
    cameraCapture.VideoTimeLimit = New TimeSpan(0, 0, 60) or if i write  TimeSpan(0, 0, 30)  video record stops in a 6 sec.
    Is there any way to solve it? and is there any alternative to CameraCaptureDialog?

    here is my code..

    video_name = response.Response_id.ToString() & extention

             Dim cameraCapture As New CameraCaptureDialog()

            cameraCapture.Owner = Me
            cameraCapture.Resolution = New Size(300, 240)
            cameraCapture.Title = "Video"
            cameraCapture.Mode = CameraCaptureMode.VideoWithAudio
            cameraCapture.DefaultFileName = video_name
            cameraCapture.InitialDirectory = directory
            cameraCapture.StillQuality = CameraCaptureStillQuality.Normal

            'Do we need this?
            'cameraCapture.Mode = CameraCaptureMode.Still
            cameraCapture.VideoTypes = CameraCaptureVideoTypes.Messaging
            cameraCapture.VideoTimeLimit = New TimeSpan(0, 0, 30) 'time limeted to 30 seconds of video
          
          
                If (DialogResult.OK = cameraCapture.ShowDialog()) Then

                    MessageBox.Show("Video saved successfully")

                   
               End If

                cameraCapture.Dispose()

               
          
    Tuesday, June 2, 2009 4:44 PM

Answers

  • cameraCapture.Mode = CameraCaptureMode.Still <- not needed
    cameraCapture.VideoTypes = CameraCaptureVideoTypes.Messaging <- not needed

    Use cameraCapture.VideoTypes = CameraCaptureVideoTypes.Standard instead.
    In the registry on some devices recording time is limited to some amount on time.

    An alternative for CamDialog is to use DirectShow, which is veeeeeeeeery difficult native c++ API.
    • Proposed as answer by Mal Loth Tuesday, June 2, 2009 7:58 PM
    • Marked as answer by warrentang Friday, June 5, 2009 8:00 AM
    Tuesday, June 2, 2009 4:56 PM

All replies

  • cameraCapture.Mode = CameraCaptureMode.Still <- not needed
    cameraCapture.VideoTypes = CameraCaptureVideoTypes.Messaging <- not needed

    Use cameraCapture.VideoTypes = CameraCaptureVideoTypes.Standard instead.
    In the registry on some devices recording time is limited to some amount on time.

    An alternative for CamDialog is to use DirectShow, which is veeeeeeeeery difficult native c++ API.
    • Proposed as answer by Mal Loth Tuesday, June 2, 2009 7:58 PM
    • Marked as answer by warrentang Friday, June 5, 2009 8:00 AM
    Tuesday, June 2, 2009 4:56 PM
  • Thank you!
    the problem was in cameraCapture.VideoTypes = CameraCaptureVideoTypes.Messaging  i realy didn't need it and bacause of it time was cutting down.
    Tuesday, June 2, 2009 5:57 PM