locked
Broadcast IP Cam RRS feed

  • Question

  • User1374224413 posted

    Hi, I need to make a cloud server to manage broadcasts and be able to view an ip cam live on my browser; in practice it would be an iptv.
    What kind of application would you recommend me to do?

    Monday, July 8, 2019 1:57 PM

All replies

  • User475983607 posted

    Hi, I need to make a cloud server to manage broadcasts and be able to view an ip cam live on my browser; in practice it would be an iptv.
    What kind of application would you recommend me to do?

    You are in the wrong support forum.  You need a networking forum or you need to read the IP Camera documentation.

    In general a browser connects to an IP Camera using a URL or IP address.  The IP camera is generally in a local network.  You need to expose the internal IP using NAT or port forwarding.  Depends on your network.   Once you can connect to the camera there are JavaScript libraries (Google Search) that allow you to stream content to the browser.  

    I'm not sure what iptv has to do with an IP camera.

    Monday, July 8, 2019 2:12 PM
  • User1374224413 posted

    Hello and sorry if I wrote here then, maybe I also explained myself badly;
    I easily access these cameras from browser, but the problem remains the band, I should develop in c # a server that makes me a cloud for the connection with many users.

    Monday, July 8, 2019 2:17 PM
  • User475983607 posted

    Hello and sorry if I wrote here then, maybe I also explained myself badly;
    I easily access these cameras from browser, but the problem remains the band, I should develop in c # a server that makes me a cloud for the connection with many users.

    An IP Camera is access by IP regardless if camera stream is buffered by a server or allows client connections.  The client, whatever that is, must reach the IP camera.  If you can connect to the IP camera from any client including a web server then it is not clear what problem you are trying to solve. 

    What is "band"?  Do you mean bandwidth or concurrent connections?  Again, your IP Camera documentation will cover the capabilities of your camera.

    Perhaps you are looking for Cloud Media Services?

    https://azure.microsoft.com/en-us/services/media-services/

    Monday, July 8, 2019 2:37 PM
  • User1374224413 posted

    Yes i mean bandwidth, sorry my english but im using translator.

    in practice what I should do is this:
    they send me a video stream, a camera that broadcasts live;
    I have to make sure that many users can connect to my application without having bandwidth problems.

    Monday, July 8, 2019 3:10 PM
  • User283571144 posted

    Hi Webcom,

    As far as I know, the bandwidth problems is related with your servers environment.  If you want to build the whole media service by yourself, you should contract with your network provider company to make sure they could support big bandwidth.

    But if you don'want to consider the bandwidth problem, Azure media service is a good choice.

    Azure Media Services makes it easy to use high-definition video encoding and streaming services to reach your audiences on today’s most popular devices. Azure Media Services also enables you to extract richer metadata though video AI, improve accessibility, distribution, and scalability —all while protecting your content.

    https://azure.microsoft.com/en-us/services/media-services/ 

    Best Regards,

    Brando

    Tuesday, July 9, 2019 2:33 AM
  • User1374224413 posted

    hello and thank you so much for your answers.
    Assuming bandwidth is not a problem, I wanted to know if you think I'm on the right track:

    I did this server side method for reading the stream

                try
                {
                    while (true)
                    {
                        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(CamUrl);
                        HttpWebResponse myHttpWebResponse = (HttpWebResponse)httpRequest.GetResponse();
                        using (Stream dataStream = myHttpWebResponse.GetResponseStream())
                        {
                            byte[] buffer = new byte[((HttpWebResponse)myHttpWebResponse).ContentLength];
                            int nbrByte = dataStream.Read(buffer, 0, buffer.Length);
                            await writer.WriteAsync(buffer);
                        }
                        await Task.Delay(delay, cancellationToken);
                        cancellationToken.ThrowIfCancellationRequested();
                    }
                }
                catch (Exception ex)
                {
                    writer.TryComplete(ex);
                }
    
                writer.TryComplete();

    and this javascript then to print on video but it doesn't work

    var URL = window.URL || window.webkitURL;
    var videoSource = document.getElementById('videoSource');
    var b = new Blob([item], { type: 'video/ogg' });
    videoSource.src = URL.createObjectURL(b);

    do you think i'm wrong way?

    Tuesday, July 9, 2019 6:15 AM
  • User283571144 posted

    Hi Webcom,

    Do you mean you want to use asp.net servcer-side codes to become a media service buffer? Could you please tell me how you call this media service buffer?

    I suggest you could refer to below article to know how the live steam work in html5 video tag.

    https://medium.com/canal-tech/how-video-streaming-works-on-the-web-an-introduction-7919739f7e1 

    Best Regards,

    Brando

    Wednesday, July 10, 2019 2:29 AM
  • User1374224413 posted

    yes perfect, this is a very good guide thanks.

    so in a code that i posted 

    try
                {
                    while (true)
                    {
                        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(CamUrl);
                        HttpWebResponse myHttpWebResponse = (HttpWebResponse)httpRequest.GetResponse();
                        using (Stream dataStream = myHttpWebResponse.GetResponseStream())
                        {
                            byte[] buffer = new byte[((HttpWebResponse)myHttpWebResponse).ContentLength];
                            int nbrByte = dataStream.Read(buffer, 0, buffer.Length);
                            await writer.WriteAsync(buffer);
                        }
                        await Task.Delay(delay, cancellationToken);
                        cancellationToken.ThrowIfCancellationRequested();
                    }
                }
                catch (Exception ex)
                {
                    writer.TryComplete(ex);
                }
    
                writer.TryComplete();

    i have to create a segment for send to a client? do you have some example for do this?

    Wednesday, July 10, 2019 8:38 AM
  • User541108374 posted

    Hi,

    why would you make this yourself? There are serveral good services out there already, also from Microsoft.

    Kris.

    Thursday, July 11, 2019 8:23 AM
  • User1374224413 posted

    you mean smooth? 

    I didn't find any guide to use it with a live broadcast, do you know any guide that illustrates the client part and the server part?

    Thursday, July 11, 2019 8:44 AM
  • User1374224413 posted

    Thanks for the answers, do you think it's possible to do all this with ffmpeg ??
    in practice the stream that comes to me is rtmp and besides the broadcast I have to make it available for access in http.

    Wednesday, July 24, 2019 7:17 AM