I want to play AVI video in C# and have an event triggered on every new frame. I'm using the video library from AForge.NET and I was able to get this working, but there's no sound. When searching for the reason, I read that AForge is not aimed at streaming video with sound.
This is my code:
AForge.Controls.VideoSourcePlayer myplayer = new AForge.Controls.VideoSourcePlayer();
FileVideoSource myvid = new FileVideoSource("C:\\Users\\Public\\Videos\\Sample Videos\\Wildlife.wmv");
private void Form1_Load(object sender, EventArgs e)
{
myplayer.NewFrame += myplayer_NewFrame;
myplayer.Size = new Size(400, 400);
myplayer.Location = new Point(100, 50);
this.Controls.Add(myplayer);
myplayer.Dock = DockStyle.Fill;
myplayer.VideoSource = myvid;
}
private void button3_Click(object sender, EventArgs e)
{
myplayer.Start();
}
How can I play sound with my video?
Aucun commentaire:
Enregistrer un commentaire