简体   繁体   English

C#如何获取流ffmpeg视频?

[英]C# How to get stream ffmpeg video?

I'm trying to get ffmpeg stream video from ip camera. 我正在尝试从IP摄像机获取ffmpeg流视频。 My problem is that i know how to get mpeg stream, but the camera type is ffmpeg. 我的问题是我知道如何获取mpeg流,但是相机类型为ffmpeg。 Do you know how to get ffmpeg stream? 您知道如何获取ffmpeg流吗? Is there some simple method as this below to do it? 下面有一些简单的方法可以做到吗? I would like to avoid rtsp implementation becouse it's hard to find some good rtsp documentation. 我想避免rtsp实施,因为很难找到一些好的rtsp文档。 Here is the code to get mpeg streams: 这是获取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;
    }

Funny, only i had to do was adding VLC plugin and now it works and looks like this: 有趣的是,我唯一要做的就是添加VLC插件,现在它可以正常工作,看起来像这样:

 public Form1()
         {
             InitializeComponent();
             axVLCPlugin21.playlist.add("rtsp://someurl");
             axVLCPlugin21.playlist.play();
         }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM