.vbs in .asp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stecahill
    New Member
    • Nov 2007
    • 9

    .vbs in .asp

    i have a .vbs file called "ConvertAVItoSW F.vbs"

    This is the script for ConvertAVItoSWF .vbs file:

    ' ////////////////////////////////////////////////
    ' converting AVI video into FLV using FFMPEG Scout
    ' ////////////////////////////////////////////////

    W = 640
    H = 480
    Set VideoConverter = CreateObject("F FMpegScout.Appl ication")
    VideoConverter. InputFileName = "testvideo. avi"
    VideoConverter. OutputFileName = "testvideo. flv"
    VideoConverter. Execute

    Set VideoConverter = Nothing




    I would like to use this script and make it work in .asp

    any help?

    ive already tried this: (but no luck)

    <%@LANGUAGE="VB SCRIPT"%>
    <%
    W = 640
    H = 480
    Set VideoConverter = CreateObject("F FMpegScout.Appl ication")
    VideoConverter. InputFileName = "testvideo. avi"
    VideoConverter. OutputFileName = "testvideo. flv"
    VideoConverter. Execute

    Set VideoConverter = Nothing

    %>


    also, this: (but again, no luck)

    <%
    Dim VideoConverter As New Object
    VideoConverter = CreateObject("F FMpegScout.Appl ication")
    VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
    VideoConverter. OutputFileName = "testvideo. flv"
    VideoConverter. Execute()
    VideoConverter = Nothing
    %>


    PLEASE HELP!
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    try "server.createo bject...", in ASP the server is actually doing the work, so you have to specify that the server should create objects.

    Comment

    • stecahill
      New Member
      • Nov 2007
      • 9

      #3
      <%
      server.createob ject "VideoConverter "
      VideoConverter = CreateObject("F FMpegScout.Appl ication")
      VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
      VideoConverter. OutputFileName = "testvideo. flv"
      VideoConverter. Execute()
      VideoConverter = Nothing

      %>


      i get this error:

      Error Type:
      Server object, ASP 0177 (0x800401F3)
      Invalid class string
      /ffmpeg/FFMPEGScout/CONVERT.asp, line 2

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        sorry, I meant [code=asp]set videoConverter = server.createob ject("FFMpegSco ut.Application" )[/code]This should be the only line with the phrase "createObje ct" in it.

        Jared

        Comment

        • stecahill
          New Member
          • Nov 2007
          • 9

          #5
          <%

          set videoConverter = server.createob ject("FFMpegSco ut.Application" )
          VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
          VideoConverter. OutputFileName = "testvideo. flv"
          VideoConverter. Execute()
          VideoConverter = Nothing

          %>

          the code above gets the error below:

          Error Type:
          Microsoft VBScript runtime (0x800A005B)
          Object variable not set: 'videoConverter '
          /ffmpeg/FFMPEGScout/CONVERT.asp, line 7


          then wen i delete line 7 to get this:

          <%

          set videoConverter = server.createob ject("FFMpegSco ut.Application" )
          VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
          VideoConverter. OutputFileName = "testvideo. flv"
          VideoConverter. Execute()

          %>


          i get no error but it doesnt convert the video.

          Comment

          • stecahill
            New Member
            • Nov 2007
            • 9

            #6
            i then tried:

            <%
            Dim VideoConverter As New Object
            set videoConverter = server.createob ject("FFMpegSco ut.Application" )
            VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
            VideoConverter. OutputFileName = "testvideo. flv"
            VideoConverter. Execute()


            %>

            but i get this error:

            Error Type:
            Microsoft VBScript compilation (0x800A0401)
            Expected end of statement
            /ffmpeg/FFMPEGScout/CONVERT.asp, line 2, column 19
            Dim VideoConverter As New Object

            Comment

            • jhardman
              Recognized Expert Specialist
              • Jan 2007
              • 3405

              #7
              in ASP you can't say "dim xxx AS anything", just "dim xxx", but that's not the problem. The error was in the line where you said [code=asp]videoConverter = nothing[/code] This should be [code=asp]set videoConverter = nothing[/code]Let me know if this helps.

              Jared

              Comment

              • stecahill
                New Member
                • Nov 2007
                • 9

                #8
                Thanks for the reply.

                i now have the code:

                <%
                Dim VideoConverter
                set videoConverter = server.createob ject("FFMpegSco ut.Application" )
                VideoConverter. InputFileName = "testvideo. avi" ' This file is in root folder
                VideoConverter. OutputFileName = "testvideo. flv"
                VideoConverter. Execute()
                set VideoConverter = Nothing

                %>


                i have no error report but it doesnt convert the video, any suggestions?


                ------------ Edit

                im just editing this comment to inform you that i now have it working, i changed the video directory to an actual directory eg:

                E:\ffmpeg\FFMPE GScout\testvide o.avi

                Comment

                • jhardman
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3405

                  #9
                  Glad you got it working!

                  Thanks for posting your solution.

                  Jared

                  Comment

                  • stecahill
                    New Member
                    • Nov 2007
                    • 9

                    #10
                    its not quite sorted yet as i fort it would be, my next problem is the flv player:

                    at the moment im using jeroen wijering's flv player.

                    this is my script
                    Code:
                    <html>
                    <head>
                    
                    
                    <script type="text/javascript" src="swfobject.js"></script>
                    
                    
                    </head>
                    <body>
                    
                    
                    <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
                    <script type="text/javascript">
                    	var s1 = new SWFObject("mediaplayer.swf","single","260","160","7");
                    	s1.addParam("allowfullscreen","true");
                    	s1.addVariable("file","../flv/golfers.flv");
                    	s1.addVariable("width","260");
                    	s1.addVariable("height","160");
                    	s1.write("player1");
                    </script>
                    
                    
                    </body>
                    </html>
                    if i open this file localy, (E:\Site-Style\htdocs\ff mpeg\FFMPEGScou t\player\mediap layer.html) then it works fine and plays the flv video.

                    but when i open it using IIS (http://steven/ffmpeg/FFMPEGScout/player/mediaplayer.htm l) then the flv video doesnt play.

                    any suggestions?

                    Comment

                    • jhardman
                      Recognized Expert Specialist
                      • Jan 2007
                      • 3405

                      #11
                      both ways on the same computer?

                      Jared

                      Comment

                      • stecahill
                        New Member
                        • Nov 2007
                        • 9

                        #12
                        yes, my computer name is called 'Steven' (my name) and so to view it on my IIS server, as you all know i have to go into either:





                        so, http://steven/ffmpeg/FFMPEGScout/pla...diaplayer.html is reading the same file as (E:\Site-Style\htdocs\ff mpeg\FFMPEGScou t\player\mediap layer.html)

                        but, when its viewed from my hardrive and not iis it works, but when viewed via iis, it doesnt load the flv.

                        im finding it hard to explain this and the above statement may not be clear so heres another explanation:

                        My computer name is Steven.
                        I have made a file called 'mediaplayer.ht ml' and saved it in this directory:
                        "E:\Site-Style\htdocs\ff mpeg\FFMPEGScou t\player\"

                        when i open the file, so in the address bar of IE it states
                        "E:\Site-Style\htdocs\ff mpeg\FFMPEGScou t\player\mediap layer.html" it works fine and plays the flv video, but when i open it so in the address bar of IE it states "http://steven/ffmpeg/FFMPEGScout/player/mediaplayer.htm l" it shows the swf object (the player) but it doesnt play the flv video.

                        this is the code for mediaplayer.htm l

                        Code:
                        <html>
                        <head>
                         
                         
                        <script type="text/javascript" src="swfobject.js"></script>
                         
                         
                        </head>
                        <body>
                         
                         
                        <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
                        <script type="text/javascript">
                            var s1 = new SWFObject("mediaplayer.swf","single","260","160","7");
                            s1.addParam("allowfullscreen","true");
                            s1.addVariable("file","../flv/golfers.flv");
                            s1.addVariable("width","260");
                            s1.addVariable("height","160");
                            s1.write("player1");
                        </script>
                         
                         
                        </body>
                        </html>

                        Comment

                        • jhardman
                          Recognized Expert Specialist
                          • Jan 2007
                          • 3405

                          #13
                          Originally posted by stecahill
                          yes, my computer name is called 'Steven' (my name) and so to view it on my IIS server, as you all know i have to go into either:





                          so, http://steven/ffmpeg/FFMPEGScout/pla...diaplayer.html is reading the same file as (E:\Site-Style\htdocs\ff mpeg\FFMPEGScou t\player\mediap layer.html)
                          That's what I thought you meant. Are there any errors or broken link notices, or does it just fail? Have you tried looking at it with a remote computer?

                          Is there any different way you could do this line? [code=asp] s1.addVariable( "file","../flv/golfers.flv");[/code]That's my best guess of where the problem could be.

                          Jared

                          Comment

                          • stecahill
                            New Member
                            • Nov 2007
                            • 9

                            #14
                            Originally posted by jhardman
                            That's what I thought you meant. Are there any errors or broken link notices, or does it just fail? Have you tried looking at it with a remote computer?

                            Is there any different way you could do this line? [code=asp] s1.addVariable( "file","../flv/golfers.flv");[/code]That's my best guess of where the problem could be.

                            Jared

                            no there is no way else unless i move the flv folder to the same location as the mediaplayer.htm l and the player.swf.

                            Also, i have not looked at it from a remote computer, and no there are no errors or broken links, it just doesnt load the flv, the player just keeps tryin to load the flv file.

                            Comment

                            • stecahill
                              New Member
                              • Nov 2007
                              • 9

                              #15
                              i think it has something to do with IIS. i can play swf video's using the swf player, but not flv. The MIME type must not be configured with IIS of some kind. I did try adding it according to these instructions:



                              but wen i add the extension to IIS, the webpage no longer displays. Im in a right mess, and the only option that looks clear right now would be to change the converter to convert the videos to .swf and play them as .swf files.

                              Comment

                              Working...