I now have captured images streaming to memory. I just have to figure out how to get ffmpeg to access that memory so it could convert everything into a movie file. Removing the Picturebox code from the project will improve on the frame capture. The picturebox is just to prove that the memory stream works.
The updated project is attached at the bottom of this post.
The Capture Timer:
Code:Private Sub VidREC_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VidREC.Tick Dim ct As Integer = CInt(ComboBox1.SelectedItem) Dim Frames As Integer = Convert.ToInt32(Label3.Text) VidREC.Interval = ct Label7.Text = "Recording" Dim BMP As New System.Drawing.Bitmap(MonitorWidth, MonitorHeight) Dim Cap As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP) Dim imgStream As MemoryStream = New MemoryStream() Cap.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize) BMP.Save(imgStream, System.Drawing.Imaging.ImageFormat.Jpeg) PictureBox1.Image = Image.FromStream(imgStream) Frames = Frames + 1 Label3.Text = Convert.ToString(Frames) If Label1.Text = "stop" Then VidREC.Enabled = False ComboBox1.SelectedIndex = 3 End If BMP.Dispose() Cap.Dispose() End Sub




Reply With Quote
