I've got a video camera hooked up to my computer through a firewire port. I'm trying to play the tape in the camera and encode it on my computer using Windows Media Encoder. I've got everything working, but I cannot capture when it has stopped encoding. I'm using a 'MyEncoer.start' command to start the encoding, but it does not sit there while in encodes....it continues through the rest of the code. I've found some examples, but they're all for VB 6 and not .NET. Below is my code. Anyone know what I need to do in order to capture the runstate change??? Thanks in advance!!
I tried this loop but it doesn't work:
While (Encoder.RunState = WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING)
System.Threading.Thread.Sleep(2000)
End While
This is the VB 6 sub example, but my code never calls this sub:
Private Sub Encoder_OnStateChange(ByVal enumState As WMEncoderLib.WMENC_ENCODER_STATE)
Select Case enumState
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING Labeltest.Text = "Running"
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_STOPPED
Labeltest.Text = "Stopped"
End Select
End sub
I tried this loop but it doesn't work:
While (Encoder.RunState = WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING)
System.Threading.Thread.Sleep(2000)
End While
This is the VB 6 sub example, but my code never calls this sub:
Private Sub Encoder_OnStateChange(ByVal enumState As WMEncoderLib.WMENC_ENCODER_STATE)
Select Case enumState
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING Labeltest.Text = "Running"
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_STOPPED
Labeltest.Text = "Stopped"
End Select
End sub