C#如何获取流ffmpeg视频?

标签 c# video ffmpeg stream

我正在尝试从 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/

相关文章:

ios - 警告 : under normal conditions, _fillInQueueWithExtraSpace:ignoreExistingItems: 不应重新输入

node.js - 如何使用 fluent-ffmpeg 从图像缓冲区创建视频?

FFMPEG:创建一个视频,该视频具有 n 输入视频的每个像素的最大值

c# - Visual Studio 2015 : Create an Empty Project

c# - 如何在 C# 的 PowerShell.AddParameter 方法中使用 powershell 变量?

c# - 如何将列表中的所有项目绑定(bind)到DataGridView?

css - html5 流畅的视频解决方案

c# - 如何在 VS2010 中创建 .NET2 兼容的应用程序?

android - 渲染视频帧的最佳方法是什么?

macos - brew install FFmpeg,在 Mac v10.15.5 上找不到 FFmpeg 命令