我正在尝试从 ip camera 获取 ffmpeg 流视频。我的问题是我知道如何获取 mpeg 流,但相机类型是 ffmpeg。你知道如何获取 ffmpeg 流吗?有没有像下面这样的简单方法来做到这一点?我想避免 rtsp 实现,因为很难找到一些好的 rtsp 文档。这是获取 mpeg 流的代码:
using System.Windows.Forms;
using AForge;
using AForge.Video;
//using AForge.Video.FFMPEG;
public partial class Form1 : Form
{
MJPEGStream stream;
public Form1()
{
InitializeComponent();
stream = new MJPEGStream("stream_url");
stream.NewFrame += stream_NewFrame;
}
void stream_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap bmp = (Bitmap)eventArgs.Frame.Clone();
pictureBox1.Image = bmp;
}
最佳答案
有趣的是,我只需要添加 VLC 插件,现在它可以工作了,看起来像这样:
public Form1()
{
InitializeComponent();
axVLCPlugin21.playlist.add("rtsp://someurl");
axVLCPlugin21.playlist.play();
}
关于C#如何获取流ffmpeg视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38787048/