خطأ عندما أستخدم aforge FFMPEG


مرحبا الرجال
أستخدم Aforge lib في مشروعي لالتقاط الصور وتسجيل الفيديو المباشر من webCam…
ولكن عند استخدام ffmpeg.dll لحفظ ملف AVI من كاميرا الويب، أرسل هذا الخطأ:

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

خطأ في الصورة:

[^]

كيفية التعامل مع هذا الخطأ؟
شكرًا

ما حاولت:

كيفية التعامل مع هذا الخطأ؟
أنا لا أعرف العمل

الحل 1

يرى فئة قارئ ملفات الفيديو[^] للحصول على تعليمات حول التثبيت والاستخدام.

الحل 2

استخدم Picturebox للفاصل الزمني وffmpeg.exe لإنشاء الفيديو، ويبدو أن AForge.Video.FFMPEG لا يعمل!

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をコピーしました