Error cuando uso aforge FFMPEG

programación


hola chicos
Utilizo Aforge lib en mi proyecto para capturar imágenes y grabar videos en vivo desde webCam…
pero cuando use ffmpeg.dll para guardar el archivo AVI desde la cámara web, envíe este error:

C#
private VideoFileWriter FileWriter = new VideoFileWriter();
        FileWriter.Open("test.avi", 460, 500, 25, VideoCodec.Default, 5000000);
            img = (Bitmap)videoSourcePlayer.GetCurrentVideoFrame().Clone();
        FileWriter.WriteVideoFrame(img);

Imagen de error:

[^]

¿Cómo manejar este error?
gracias

Lo que he probado:

¿Cómo manejar este error?
no se trabajo

Solución 1

Ver Clase VideoFileReader[^] para obtener instrucciones sobre instalación y uso.

Solución 2

Utilice Picturebox para timelapse y ffmpeg.exe para crear el vídeo. ¡AForge.Video.FFMPEG parece no funcionar!

private void button4_Click(object sender, EventArgs e)
{
    //timelapse
    string basepath = Application.StartupPath.ToString();
    var imagescount = 60;
    var fps = 10;

    timer1.Enabled = true;
    timer1.Interval = 1000;
    timer1.Start();
   
}

private void timer1_Tick(object sender, EventArgs e)
{
    string basepath = Application.StartupPath.ToString();
    var imagescount = 60;
    int width = 1280;
    int height = 720;            

    // write 60 video frames            
    Bitmap image = (Bitmap)pictureBox1.Image.Clone();
    pictureBox4.Image = image;
    pictureBox4.Refresh();

}

コメント

タイトルとURLをコピーしました