473,385 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.vbs in .asp

i have a .vbs file called "ConvertAVItoSWF.vbs"

This is the script for ConvertAVItoSWF.vbs file:

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

W = 640
H = 480
Set VideoConverter = CreateObject("FFMpegScout.Application")
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="VBSCRIPT"%>
<%
W = 640
H = 480
Set VideoConverter = CreateObject("FFMpegScout.Application")
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("FFMpegScout.Application")
VideoConverter.InputFileName = "testvideo.avi" ' This file is in root folder
VideoConverter.OutputFileName = "testvideo.flv"
VideoConverter.Execute()
VideoConverter = Nothing
%>


PLEASE HELP!
Nov 17 '07 #1
14 3521
jhardman
3,406 Expert 2GB
try "server.createobject...", in ASP the server is actually doing the work, so you have to specify that the server should create objects.
Nov 19 '07 #2
<%
server.createobject "VideoConverter"
VideoConverter = CreateObject("FFMpegScout.Application")
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
Nov 19 '07 #3
jhardman
3,406 Expert 2GB
sorry, I meant
Expand|Select|Wrap|Line Numbers
  1. set videoConverter = server.createobject("FFMpegScout.Application")
This should be the only line with the phrase "createObject" in it.

Jared
Nov 19 '07 #4
<%

set videoConverter = server.createobject("FFMpegScout.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.createobject("FFMpegScout.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.
Nov 20 '07 #5
i then tried:

<%
Dim VideoConverter As New Object
set videoConverter = server.createobject("FFMpegScout.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
Nov 20 '07 #6
jhardman
3,406 Expert 2GB
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
Expand|Select|Wrap|Line Numbers
  1. videoConverter = nothing
This should be
Expand|Select|Wrap|Line Numbers
  1. set videoConverter = nothing
Let me know if this helps.

Jared
Nov 20 '07 #7
Thanks for the reply.

i now have the code:

<%
Dim VideoConverter
set videoConverter = server.createobject("FFMpegScout.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\FFMPEGScout\testvideo.avi
Nov 21 '07 #8
jhardman
3,406 Expert 2GB
Glad you got it working!

Thanks for posting your solution.

Jared
Nov 21 '07 #9
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
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4.  
  5. <script type="text/javascript" src="swfobject.js"></script>
  6.  
  7.  
  8. </head>
  9. <body>
  10.  
  11.  
  12. <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
  13. <script type="text/javascript">
  14.     var s1 = new SWFObject("mediaplayer.swf","single","260","160","7");
  15.     s1.addParam("allowfullscreen","true");
  16.     s1.addVariable("file","../flv/golfers.flv");
  17.     s1.addVariable("width","260");
  18.     s1.addVariable("height","160");
  19.     s1.write("player1");
  20. </script>
  21.  
  22.  
  23. </body>
  24. </html>
if i open this file localy, (E:\Site-Style\htdocs\ffmpeg\FFMPEGScout\player\mediaplayer .html) then it works fine and plays the flv video.

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

any suggestions?
Nov 21 '07 #10
jhardman
3,406 Expert 2GB
both ways on the same computer?

Jared
Nov 22 '07 #11
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:

http://Steven/
http://localhost/
http://127.0.0.1

so, http://steven/ffmpeg/FFMPEGScout/pla...diaplayer.html is reading the same file as (E:\Site-Style\htdocs\ffmpeg\FFMPEGScout\player\mediaplayer .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.html' and saved it in this directory:
"E:\Site-Style\htdocs\ffmpeg\FFMPEGScout\player\"

when i open the file, so in the address bar of IE it states
"E:\Site-Style\htdocs\ffmpeg\FFMPEGScout\player\mediaplayer .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.html" it shows the swf object (the player) but it doesnt play the flv video.

this is the code for mediaplayer.html

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.  
  4.  
  5. <script type="text/javascript" src="swfobject.js"></script>
  6.  
  7.  
  8. </head>
  9. <body>
  10.  
  11.  
  12. <p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
  13. <script type="text/javascript">
  14.     var s1 = new SWFObject("mediaplayer.swf","single","260","160","7");
  15.     s1.addParam("allowfullscreen","true");
  16.     s1.addVariable("file","../flv/golfers.flv");
  17.     s1.addVariable("width","260");
  18.     s1.addVariable("height","160");
  19.     s1.write("player1");
  20. </script>
  21.  
  22.  
  23. </body>
  24. </html>
  25.  
Nov 22 '07 #12
jhardman
3,406 Expert 2GB
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:

http://Steven/
http://localhost/
http://127.0.0.1

so, http://steven/ffmpeg/FFMPEGScout/pla...diaplayer.html is reading the same file as (E:\Site-Style\htdocs\ffmpeg\FFMPEGScout\player\mediaplayer .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?
Expand|Select|Wrap|Line Numbers
  1.     s1.addVariable("file","../flv/golfers.flv");
That's my best guess of where the problem could be.

Jared
Nov 23 '07 #13
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?
Expand|Select|Wrap|Line Numbers
  1.     s1.addVariable("file","../flv/golfers.flv");
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.html 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.
Nov 23 '07 #14
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:

http://kb.adobe.com/selfservice/view...9439&sliceId=2

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.
Nov 23 '07 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.