ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > UrlSnooper

What do you use to record rtsp://?

<< < (2/2)

It seems that screen capture program is definitely able to do so! 

We are also using C#, specifically ozeki's camera sdk.

On this website u can read about how to create an onvif or rtsp network video recorder in C#. Using the following code (and the VoIPSDK.dll that can be downloaded from the previously webpage), you can easily record rtsp stream.

In the GetCamera method you need the provide the IP address of your rtsp IP camera, and the username and the password you use for login. !IMPORTANT: you need to use the "rtsp://" prefix in front of the ip address.

--- Code: C# ---GetCamera("rtsp://", "admin", "admin");

--- Code: C# ---using System;using System.Drawing;using System.Windows.Forms;using Ozeki.Media.IPCamera;using Ozeki.Media.MediaHandlers.Video;using Ozeki.Media.Video.Controls;using Ozeki.Media.MediaHandlers; namespace Network_Video_Recorder01{    public partial class Form1 : Form    {        private IIPCamera _camera;        private DrawingImageProvider _imageProvider;        private MediaConnector _connector;        private VideoViewerWF _videoViewerWf;        private MPEG4Recorder _mpeg4Recorder;         public Form1()        {            InitializeComponent();            _imageProvider = new DrawingImageProvider();            _connector = new MediaConnector();            _videoViewerWf = new VideoViewerWF();            SetVideoViewer();        }         private void SetVideoViewer()        {            CameraBox.Controls.Add(_videoViewerWf);            _videoViewerWf.Size = new Size(260, 180);            _videoViewerWf.BackColor = Color.Black;            _videoViewerWf.TabStop = false;            _videoViewerWf.Location = new Point(14, 19);            _videoViewerWf.Name = "_videoViewerWf";        }         private void button_Connect_Click(object sender, EventArgs e)        {            _camera = IPCameraFactory.GetCamera("rtsp://", "admin", "admin");            _connector.Connect(_camera.VideoChannel, _imageProvider);            _videoViewerWf.SetImageProvider(_imageProvider);            _videoViewerWf.Start();            _camera.Start();        }         private void Button_CaptureVideoStart_Click(object sender, EventArgs e)        {            var path = TextBox_SaveTo.Text;            if (!String.IsNullOrEmpty(path))                StartVideoCapture(path);        }         private void StartVideoCapture(string path)        {            var date = DateTime.Now.Year + "y-" + DateTime.Now.Month + "m-" + DateTime.Now.Day + "d-" +                       DateTime.Now.Hour + "h-" + DateTime.Now.Minute + "m-" + DateTime.Now.Second + "s";            string currentpath;            if (String.IsNullOrEmpty(path))                currentpath = date + ".mp4";            else                currentpath = path + "\\" + date + ".mp4";             _mpeg4Recorder = new MPEG4Recorder(currentpath);            _mpeg4Recorder.MultiplexFinished += Mpeg4Recorder_MultiplexFinished;            _connector.Connect(_camera.AudioChannel, _mpeg4Recorder.AudioRecorder);            _connector.Connect(_camera.VideoChannel, _mpeg4Recorder.VideoRecorder);        }         private void Mpeg4Recorder_MultiplexFinished(object sender, Ozeki.VoIP.VoIPEventArgs<bool> e)        {            _connector.Disconnect(_camera.AudioChannel, _mpeg4Recorder.AudioRecorder);            _connector.Disconnect(_camera.VideoChannel, _mpeg4Recorder.VideoRecorder);            _mpeg4Recorder.Dispose();        }         private void Button_CaptureVideoStop_Click(object sender, EventArgs e)        {            StopVideoCapture();        }         private void StopVideoCapture()        {            _mpeg4Recorder.Multiplex();            _connector.Disconnect(_camera.AudioChannel, _mpeg4Recorder.AudioRecorder);            _connector.Disconnect(_camera.VideoChannel, _mpeg4Recorder.VideoRecorder);        }         private void Button_SaveTo_Click(object sender, EventArgs e)        {            var result = folderBrowserDialog1.ShowDialog();            if (result == DialogResult.OK)                TextBox_SaveTo.Text = folderBrowserDialog1.SelectedPath;        }    }}


[0] Message Index

[*] Previous page

Go to full version