Redirect Video Stream through asp file

Author Message
cyf

  • Total Posts : 22
  • Scores: 0
  • Reward points : 0
  • Joined: 1/25/2007
  • Status: offline
Redirect Video Stream through asp file Monday, November 10, 2008 3:39 AM (permalink)
0
We have a video stream that has been setup and is definately working on its own from an address that is only available internally. What we need to do it read that stream via another asp file that can also be treated as a stream (i suppose bounce the stream or treat it as a proxy) this is because the second asp will be availableexternally and will allow us to control who has access to the feed at a later date.
any suggestions? we were trying to use ado.stream object but were having problems getting it to work?
This is the code we were trying to use to get the stream and then output it from file2.asp (code below)

 <%
 'Create a stream object
 Dim objStream
 Set objStream = Server.CreateObject("ADODB.Stream")
 
 objStream.Open
 objStream.LoadFromFile "[link=http://123.123.123.123/mystream.cgi?camera=1][color=#0000ff]http://123.123.123.123/mystream.cgi?camera=1[/color][/link]"
 
 'Output the contents of the stream object
 Response.ContentType = "video/x-ms-wmv"
 Response.BinaryWrite objStream.Read
 
 'Clean up....
 objStream.Close
 Set objStream = Nothing
 %>
 
 


thanks for any help in advance!!
<message edited by cyf on Monday, November 10, 2008 3:51 AM>
 
#1
    TNO

    • Total Posts : 2094
    • Scores: 36
    • Reward points : 0
    • Joined: 12/18/2004
    • Location: Earth
    • Status: offline
    RE: Redirect Video Stream through asp file Monday, November 10, 2008 6:09 PM (permalink)
    0
    Take a look at Server.Transfer. you can use that to treat any public facing asp page as a sentinal for internal files. The client will never see the address change
    To iterate is human, to recurse divine. -- L. Peter Deutsch
     
    #2
      cyf

      • Total Posts : 22
      • Scores: 0
      • Reward points : 0
      • Joined: 1/25/2007
      • Status: offline
      RE: Redirect Video Stream through asp file Monday, November 10, 2008 11:59 PM (permalink)
      0
      and this would work for a page that basicaly acting as a video stream?
       
      If will try this out (although not that familiar with classic asp nor video streams :) )
       
      Will post findings when i get chance, thanks in advance
      http://www.andigibson.co.uk - my blog

      http://www.zero7ict.com - web hosting and development

      http://www.socialaddict.co.uk - music and entertainment
       
      #3
        cyf

        • Total Posts : 22
        • Scores: 0
        • Reward points : 0
        • Joined: 1/25/2007
        • Status: offline
        RE: Redirect Video Stream through asp file Tuesday, November 11, 2008 1:39 AM (permalink)
        0
        Ive just been informaed that the camera stream  we are trying to access is on an internal ip address BUT is on a different pyhsical box so the Server.Transfer wont work.  Have you got any other ideas?
        http://www.andigibson.co.uk - my blog

        http://www.zero7ict.com - web hosting and development

        http://www.socialaddict.co.uk - music and entertainment
         
        #4
          TNO

          • Total Posts : 2094
          • Scores: 36
          • Reward points : 0
          • Joined: 12/18/2004
          • Location: Earth
          • Status: offline
          RE: Redirect Video Stream through asp file Tuesday, November 11, 2008 2:18 AM (permalink)
          0
          Are these all on the same network or is the other computer on a different site? Are you using your current one as a proxy or something? If all on the same network I would assume you could still use Server.Transfer since a mapped location works basically the same.
          To iterate is human, to recurse divine. -- L. Peter Deutsch
           
          #5
            cyf

            • Total Posts : 22
            • Scores: 0
            • Reward points : 0
            • Joined: 1/25/2007
            • Status: offline
            RE: Redirect Video Stream through asp file Tuesday, November 11, 2008 4:15 AM (permalink)
            0
            my collegue said the following:
             
            The source (axis webcam) and the asp (on webserver) are both on the same network yes.
            The webcam is a unix box, so while we could maybe do some stuff, network shares across different operating systems I think is a tricky scenario? (not my expertise, so might have misunderstood something). We don’t really have axis to the underlying copy of unix anyway, so just the webstuff.
             
            http://www.andigibson.co.uk - my blog

            http://www.zero7ict.com - web hosting and development

            http://www.socialaddict.co.uk - music and entertainment
             
            #6
              TNO

              • Total Posts : 2094
              • Scores: 36
              • Reward points : 0
              • Joined: 12/18/2004
              • Location: Earth
              • Status: offline
              RE: Redirect Video Stream through asp file Tuesday, November 11, 2008 12:35 PM (permalink)
              0
              If they are on the same network then how are the other window machines connected to the unix box then?  Is everything being run through SAMBA or something?
              To iterate is human, to recurse divine. -- L. Peter Deutsch
               
              #7
                cyf

                • Total Posts : 22
                • Scores: 0
                • Reward points : 0
                • Joined: 1/25/2007
                • Status: offline
                RE: Redirect Video Stream through asp file Tuesday, November 18, 2008 2:14 AM (permalink)
                0



                <!
                DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <
                html xmlns="http://www.w3.org/1999/xhtml">
                <
                head>
                <
                meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <
                title>Internal Stream - andi's test</title>
                </
                head>
                <
                body>
                 
                <
                SCRIPT LANGUAGE="JavaScript">

                // Set the BaseURL to the URL of your camera

                var
                BaseURL = "http://172.17.40.240/";

                // DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
                // You may change these numbers, the effect will be a stretched or a shrunk image

                var
                DisplayWidth = "704";

                var
                DisplayHeight = "576";

                // This is the path to the image generating file inside the camera itself

                var
                File = "axis-cgi/mjpg/video.cgi?resolution=4CIF";

                // No changes required below this point

                var
                output = "";

                if
                ((navigator.appName == "Microsoft Internet Explorer") &&
                (navigator.platform !=
                "MacPPC") && (navigator.platform != "Mac68k"))
                {
                // If Internet Explorer under Windows then use ActiveX

                output =
                '<OBJECT ID="Player" width='

                output += DisplayWidth;
                output +=
                ' height=';
                output += DisplayHeight;
                output +=
                ' CLASSID="CLSID:DE625294-70E6-45ED-B895-CFFA13AEB044" ';
                output +=
                'CODEBASE="';
                output += BaseURL;
                output +=
                'activex/AMC.cab#version=4,1,4,5">';
                output +=
                '<PARAM NAME="MediaURL" VALUE="';
                output += BaseURL;
                output += File +
                '">';
                output +=
                '<param name="MediaType" value="mjpeg-unicast">';
                output +=
                '<param name="ShowStatusBar" value="0">';
                output +=
                '<param name="ShowToolbar" value="0">';
                output +=
                '<param name="AutoStart" value="1">';
                output +=
                '<param name="StretchToFit" value="1">';
                // Remove the // for the ptz settings below to use the code for click-in-image.

                // output += '<param name="PTZControlURL" value="';

                // output += BaseURL;

                // output += '/axis-cgi/com/ptz.cgi?camera=1">';

                // output += '<param name="UIMode" value="ptz-relative">'; // or "ptz-absolute"

                output +=
                '<BR><B>Axis Media Control</B><BR>';
                output +=
                'The AXIS Media Control, which enables you ';
                output +=
                'to view live image streams in Microsoft Internet';
                output +=
                ' Explorer, could not be registered on your computer.';
                output +=
                '<BR></OBJECT>';
                }
                else {
                // If not IE for Windows use the browser itself to display

                theDate =
                new Date();
                output =
                '<IMG SRC="';
                output += BaseURL;
                output += File;
                output +=
                '&dummy=' + theDate.getTime().toString(10);
                output +=
                '" HEIGHT="';
                output += DisplayHeight;
                output +=
                '" WIDTH="';
                output += DisplayWidth;
                output +=
                '" ALT="Camera Image">';
                }
                document.write(output);
                document.Player.ToolbarConfiguration =
                "play,+snapshot,+fullscreen"

                // Remove the // below to use the code for Motion Detection.

                // document.Player.UIMode = "MDConfig";

                // document.Player.MotionConfigURL = "/axis-cgi/operator/param.cgi?ImageSource=0"

                // document.Player.MotionDataURL = "/axis-cgi/motion/motiondata.cgi";

                </
                SCRIPT>
                 
                </
                body>
                </
                html>
                 

                 
                thats how we currently view the stream - this was the code we were given and it works fine internally. We cannot modify how the .cgi file works so we need to make the url available externally and add a user logon page. I can make a logon system thats fine but i still am unsure how to allow this stream to be available externally.
                 
                itried using the .asp file posted at the very top of this page but it just hangs (presumably as its trying to download the whole stream and therefore never updates the screen but timesout)
                 
                I was thinking i need to proxy it through an asp file or something??
                 
                I have access to PHP or ASP so i can develop in either but ive never done something like this and im finding it hard to get a solution!
                 
                Hope you can help / this makes it clearer what i require
                 
                Cheers,

                Cyf
                http://www.andigibson.co.uk - my blog

                http://www.zero7ict.com - web hosting and development

                http://www.socialaddict.co.uk - music and entertainment
                 
                #8
                  TNO

                  • Total Posts : 2094
                  • Scores: 36
                  • Reward points : 0
                  • Joined: 12/18/2004
                  • Location: Earth
                  • Status: offline
                  RE: Redirect Video Stream through asp file Tuesday, November 18, 2008 6:17 AM (permalink)
                  0
                  So right now is it possible to view the webpage that has the code you just posted without logging in?
                  To iterate is human, to recurse divine. -- L. Peter Deutsch
                   
                  #9
                    cyf

                    • Total Posts : 22
                    • Scores: 0
                    • Reward points : 0
                    • Joined: 1/25/2007
                    • Status: offline
                    RE: Redirect Video Stream through asp file Tuesday, November 18, 2008 9:44 PM (permalink)
                    0
                    Yes, there is basic authentication so it prompts for username and password guest,guest which i can either set using parameters or it will prompt for then automically. The main authentication is going to be added to the proxy page when ive got the basics working!
                     
                    I've started doing this in PHP too as im a little more familiar with the language maybe someone can help with that as im a little bit further on with it!  Cheers for help TNO
                     
                    PHP VERSION ATTEMPT: http://www.visualbasicscript.com/m_66662/tm.htm
                    http://www.andigibson.co.uk - my blog

                    http://www.zero7ict.com - web hosting and development

                    http://www.socialaddict.co.uk - music and entertainment
                     
                    #10

                      Online Bookmarks Sharing: Share/Bookmark

                      Jump to:

                      Current active users

                      There are 0 members and 1 guests.

                      Icon Legend and Permission

                      • New Messages
                      • No New Messages
                      • Hot Topic w/ New Messages
                      • Hot Topic w/o New Messages
                      • Locked w/ New Messages
                      • Locked w/o New Messages
                      • Read Message
                      • Post New Thread
                      • Reply to message
                      • Post New Poll
                      • Submit Vote
                      • Post reward post
                      • Delete my own posts
                      • Delete my own threads
                      • Rate post

                      2000-2012 ASPPlayground.NET Forum Version 3.9