Video streaming for local network using C# - c#

I need to stream a video which is located in a local network between two computers using C#. I am thinking to use TCP rather than UDP since I need reliability. I already build a simple program for data transfer with TCP/IP. Now I want to build a TCP communication for video streaming. Is there any sample code or suggestion for both the server and client side for that?
I already try to open video in local network and tried to encode the video same as I do on data transfer but it didn't work.
Thanks.

Related

How to configure the TCP/IP protocol correctly?

I need to set up a TCP server and the sensor devices need to connect to it as TCP clients.
Also, when I add an mp3 file to a device in the admin panel on react, I need to send that file to the appropriate client.
In turn, the device may send me certain data.
I wanted to know how the logic and structure of this whole process should be established correctly?
What should I put my TCP server on? (.Net Core Console, API or Worker Service?)
How can I transfer my mp3 file to my TCP server from the admin panel? and so on
Thanks in advance

Streaming video from C# server to wowza streaming engine

I'm facing problem with restreaming .h264 video received from my device via tcp to wowza streaming engine. The problem is that I do not know how to forward byte array (byte[]). I have read that it is possible via rstp/rtmp/mpegts but I have not found any library to do this operation. I know that video I receive is ok because after saving frames to file I'm able to send it to wowza using ffmpeg. I have been also trying to use ffmpeg to listen on udp ip and port and on http ip and port but nothing happened.
My question is:
Is it possible to send bytes to ffmpeg without saving file on hard drive?

How to forward network packets sent by application to different Network Connection or NIC using C#?

I am trying to make a software in C# that can help to use all available network connection and download file or browse websites with the combine speed of all network connection as project. I have gone through various books and website to get some answers about how to use multiple internet connection in c#. But i haven't got the answers.
Software like IDM uses multiple connection to download file. I was thinking to capture request sent by IDM and distribute it equally to all available Network Interfaces.
Can somebody tell me some api that can create virtual network connection and can manipulate network packets and forward the packets through multiple internet connection. I want to create a virtual network adapter like in Private Tunnel (a OpenVPN software) and solve the problem.
Thanks

Stream video to an RTMP based Media Server (Red5) using C#

I am writing an C#.Net based application which requires publishing video and audio streams to Red 5 Media Server and retrieving the same published stream in another application on a local network and later on on internet.
In short, I intend to use Red5 as intermediate or proxy for the transmission of video and audio data between two clients.
[client 1] <-Video and Audio -> <- Video and Audio -> [Client 2]
I am looking for .NET implementation(library) of the RTMP protocol that can help me publish the stream to Media Server and retirve the published stream and play it back on my application.
I searched over SOF and came to these options:
Borrocoli RTMP Client Library
FlourineFx.NET
WebORb.Net
Each has some limitations.
Borrocoli RTMP Library has only plyback support for audio/video streams but there is no option of publishing a video/audio stream to the media server. I have played with the library and seen its examples but no avail. If i am wrong please correct me.
FlourinFx.Net says that supports NetStream.Publish(), NetStream.AttachAudio() and NetStream.AttachVideo() methods. But in latest snapshot of code, there is nothing like this. Same is true for their production release. The NetStream class doesn't have the stated methods and/or does not have any methods that can help publish streaming content TO the media server.
WebOrb.Net: I have not explored it, but as evident from their licensing page, the free version works with IIS only. The enterprise version seems to have all the support for publishing streaming video...
Questions:
Is it possible that I can use WebOrb.Net library in conjunction with Red5 Media Server?
Will the free version allow me to publish audio and video to Red5 media server?
Is there any other free alternative I can use if the above questions are not valid?
You can use ffmpeg to send stream to Red 5 MediaServer..
Set the source video to ffmpeg and the output to rtmp of red5, something like this:
ffmpeg -re -i file.mp4 -c copy -f flv rtmp://server/live/streamName
See this answer for an examples to integrate ffmpeg in c#.
you can use weborb.lib for peer to peer video streaming by using flex and .net via RTMP protocol.you can use for the peer to peer streaming.your process can be done by as follows...
1.develop a Flex client code connecting to the server and subscribing to receive server-side updates with the CPU readings.
The code also includes a chart to visualize the received data.
2.The server-side 'Application handler' which plugs into WebORB, polls CPU and delivers data to the client.It will works try it.
Use RTMPdump's librtmp. It's written in C but you should be able to write C# wrappers for it easily enough.

Stream across the Network with C#

I want to ask how could I stream images using C# to clients which are not local.
The idea is to let users from other computers see the images coming from the webcam connected to my PC, by typing the IP of my computer to their webbrowser.
I have succeeded in making it locally - when I access the 127.0.0.1 address on my computer, it works.
I have tried using WCF, and also TcpListener:
listener = new HttpListener();
listener.Start();
HttpListenerContext context = listener.GetContext();
HttpListenerResponse response = context.Response;
System.IO.Stream output = response.OutputStream;
...
But, when I try to make it work from outside my local network - I fail to.
My question is like this:
-Do you know any library in C# which will easily let me listen to requests and answer them by a Stream? (I am trying to let browsers access the images stream which I send to them. it works nicely locally...)
-Maybe you know of a different approach which will ease the task?
-Besides, to which address should I listen when trying to broadcast to the outside world? 127.0.0.1? the address which I see on WhatsMyIp sites?
Thank you Very Much!
Webcams with built in networking typically stream images back using MJPEG/MIME multipart.
If you have a camera with built-in networking, then it most likely already supports streaming an MJPEG stream over the network. Being able to access the camera from outside your local network is a matter of configuring your home router to pass external requests (probably on port 80) to the camera's IP address (this is known as NAT configuration). The exact process for doing this will depend on your router, but it should be fairly easy to configure.
If you have a camera without networking built-in you can build a 'proxy' on your home computer that will listen for network requests from external clients, fetch images from the camera, and send the images back as parts within the response stream. Once you have the proxy written, it will be just like the network camera in terms of external access--you will need to configure your router to allow external access.
HttpListener would be a good choice for implementing the proxy. The main work here is formatting the response.OutputStream according to the MJPEG/MIME multipart convention. Here I would recommend using StreamWriter (for the textual parts) and Image.Save for the images. Keep in mind that the MJPEG response contains a combination of textual data (for the MIME/multipart headers and boundaries) and binary data (for the actual JPEG images) contained within the MIME/multipart body. If you need to support streaming to multiple clients concurrently you will also need to use threading.
As far as the IP address to use HttpListener supports a + or * notation that avoids the need to specify any IP address. For example: http://+/Stream/ See MSDN for more information.

Categories