FLV2SWF
Description
What does the program do?
FLV2SWF converts Flash Video files (.flv) into Flash files (.swf). It can be called up from the command line or from a CGI-bin.
What are the advantages?
| - | called up easily in Flash per loadMovie out of an existing Flash-file (.swf). |
| - | recursive folder batch processing |
| - | .NET, ASP and Java interface |
| - | ZLib-Compression |
| - | Best Audioquality thanks to 1:1 sound import of RAW, Mp3 and NellyMoser |
| - | scalable (in percent or in exact pixels) |
| - | width, height, frame rate, length, scale, number of frames and optional text are also recorded |
| - | program returns are Flash compatible (&error=can't open file) |
| - | minimal Server load by conversion to Flash Video file (.flv) |
| - | much less traffic through caching of Flash files (.swf) at the client |
| - | less expensive alternative over the Capacity Packs from Macromedia Flash Communication Server MX |
| - | conversion of Flash files (.flv) with only audio (not possible in the IDE) |
| - | Assumption of NetStream.send calls |
| - | Callback by starting (onStart)and reaching movie end (onEnd) |
What are the advantages over the Streaming from Macromedia Flash Communication Server MX?
| - | caching of Streams at the client possible, which results in much less Traffic |
| - | improved control over streaming behaviour |
| - | ongoing use of of streams offline (embedding in HTML) |
| - | minimal server load, as the converted Flash files (.swf) is loaded from the Client only, there needs to be no start of another streaming process on the Server |
Which operating systems are supported?
At present the program runs on any Windows version from Windows 98 up and on Unix/Linux.
What is required?
CGI access and the Macromedia Flash Communication Server MX.
What are Flash Video files (.flv)?
Flash Video files (.flv) are generated by the Macromedia Flash Communication Server MX when video and audio data is being saved (through Webcam and Microphone).
Where is the application useful?
Originally, Flash Video files (.flv) could up to now only be streamed with Macromedia Flash Communication Server. Each replay of a stream used a connection. With the help of FLV2SWF the output of Audio and Video Streams rises up to infinity, without the need to purchase any more Capacity Packs for the Macromedia Flash Communication Server MX. You can get more information on the price und versions of Macromedia Flash Communication Server MX by clicking here.
A typical usage example: A personal edition of the Macromedia Flash Communication Server MX (50 connections) is installed on a server for the price of $499. On the server, a Videoecard-system is to be used by a client, where visitors can record audio- and video messages and send them to an arbitrary number of friends. If now 25 users record a message at the same time, 25 connections are used at that moment.
That results in only 25 messages that can be viewed by visitors at this point. The personal edition's limit is reached quickly, for every stream uses one connection. By converting the Flash Video file (.flv) after recording into a Flash file (.swf), an arbitrary number of messages can be viewed by visitors.
What are the possibilities?
| - | Music applications similiar to MusicMaker where a sample is recorded with a microphone and later used to compose a song |
| - | Multimedia-Ecard, by recording microphone and webcam data, a video with different blend-in effects can be generated and mailed |
| - | Communications portals and Wanted Ads, where Webcams and Microphones are used to set up Date and Personal Contacts that can be viewed by members of the portal (Datecam) |
| - | Personalized playing figures, where the visitor’s face will be captured in a single frame and pasted on the figure’s head (Office Chaos) |
| - | Audio/Video Blogs, Radio, ... |
What are the limitations of the demoversion?
With every conversion a demo-graphic is laid over the video in the Flash file (.swf). Also it converts only the first minute of the video.
Downloads:
| - | CGI-Version for Windows (flv2swf_win32.zip - 2.34 - 15.10.2003) |
| - | CommandLine-Version for Windows (flv2swf_win32_nocgi.zip - 2.34 - 15.10.2003) |
| - | CGI-Version for Unix/Linux (flv2swf_unix.zip - 2.34 - 15.10.2003) |
| - | CommandLine-Version for Unix/Linux (flv2swf_unix_nocgi.zip - 2.34 - 15.10.2003) |
| - | Example for Macromedia Flash Communication Server MX (flv2swf_recording.zip) |
Order
The order process is being handled by our partner ShareIt.com. Should there be any questions regarding the order process, please visit this below for further information.
Single domain license (for the use on one domain, no provider licence *)
Price (without sales tax): 199,99 Euro - Order now
Multi domain license (for unrestricted use including provider licence)
Get more information from: Carlo Blatz
* This licence allows you not to offer or rent FLV2SWF as service.
Documentation:
In General
FLV2SWF should be saved in the CGI-BIN directory of the web server. Optional it can also be operated over the command line. Absolute browser path:
http://localhost/cgi-bin/flv2swf.exe?i=input.flv
Usage per console:
flv2swf.exe -i input.flv -o output.swf
Output (1:1) of Flash Video files (.flv) on the Fly
The parameter i indicates the Video input file (.flv) that is to be converted. The request is sent back to the browser and no Flash file (.swf) is written:
flv2swf.exe?i=input.flv
Relative und absolute paths can also be used:
flv2swf.exe?i=../input.flvflv2swf.exe?i=C:/Programme/input.flv
Video output in Flash
If the input file (.flv) is not available, the message &error=can't open file is returned:
mc.loadMovie ("flv2swf.exe?i=input.flv");
Conversion (1:1) of the Flash Video files (.flv)
The optional parameter o indicates the output Flash-Player file (.swf) that is to be written. Also this output is send back to the browser.
flv2swf.exe?i=input.flv&o=output.swf
Conversion without video output in Flash
To avoid the video output in Flash after conversion use the parameter return:
mc.loadMovie ("http://localhost/cgi-bin/flv2swf.exe?i=input.flv&o=output.swf&return=0");
Conversion (Batch) of Folders
All files, existing in that directory, that is indicated by i and end with the ending .flv, will be accordingly converted and written in the directory indicated by the parameter o:
flv2swf.exe?i=inputDir/&o=outputDir/
Important is the use "\" or "/" after the folder name. Only then the path is valid. If the folder does not exist it will be created. After a successful conversion this output appears &total=29 with the total amount of the converted files.
Conversion of Flash Video files (.flv) in the same folder:
flv2swf.exe?i=./&o=./
Recursive conversion (Batch) of Folders
All files in the subdirectories, which exist inside the directory specified by i and do end with .flv, will be converted into the according Flash file (.swf). This file will be written into the directory indicated by the parameter o, if the parameter r is send along:
flv2swf.exe?i=inputDir/&o=outputDir/&r=1
Scaling of Video in percent
The optional parameter s gives the scale factor as a percentage, e.g. 50 when scaling the width and height of the movie by half:
flv2swf.exe?i=input.flv&s=50
Pixel exact Scaling of Video
The width and height of the video export can be set with the optional parameter w and h:
flv2swf.exe?i=input.flv&w=100&h=200
Saving of Text information
With the optional parameter t, text can be saved in the variable t of the Flash file (.swf):
flv2swf.exe?i=input.flv&o=output.swf&t=text
Limitations of writing privileges
By using the file flv2swf_paths.txt inside the CGI-BIN directory, writing privileges on the server can be restricted. Should the file not exist, the program has serverside writing privileges for Flash files (.swf). This might be a security risk.
Does the file exist, but is completely empty, then the program owns no serverside writing privileges. The output of Flash Video files (.flv) however still works on the fly, to save on connections at the Macromedia Flash Communication Server MX.
Does the file exist, the output file including the path, may only start with the strings, existing in that file. Thereby more than one path can be given, respectively one per line. Security reasons recommend using absolute paths. Example structure of flv2swf_paths.txt:
E:\Webserver\swfaudiosE:\Webserver\swfvideos
For security reasons it is not possible to overwrite other Flash Files (.swf). Is it attempted you receive the warning: &error=file exist.
Saved Video data
The following variables are saved with the generation of the Flash files (.swf):
wid | width of the movie |
hei | height of the movie |
len | number of frames |
fps | frame rate (at -1 no video is embedded) |
sec | length in milliseconds |
snd | Soundformat (at 0 no sound is embedded) |
s | scaling factor |
t | text information |
Error warning
The following error warning (&error) can be returned at conversion:
no input file specified | No Flash Video file (.flv) was specified. | |
no output file specified | No Flash file (.swf) was specified. | |
output name must end with .swf | Wrong filename ending for output file. | |
output name to short | The length of the output filename must be at least 4 characters long. | |
can't open file | The input file could not be opened, for example because no read access was granted. | |
invalid file size | While opening the file an illegal file length was encountered. | |
file exists | File exists already and would be overwritten in case the Flash file (.swf) gets saved under the specified file name. | |
path not found in flv2swf_paths.txt | There is flv2swf_paths.txt, but the path of the output file is not stated inside the file. |
Function calls of NetStream.send
The recorded function calls of a stream get converted into the Flash file (.swf) and will be called exactly in sync while playback. The method is called in the scope (this) of the Flash film (.swf).
While passing parameters only one string parameter is allowed, for more parameters it has to be in the format "a;b;c", so that the parameters can be seperated later on with String.split (",").
Callback by reaching movie end
At the begin of the movie (.swf) the function this.onStart(); and at end this.onEnd(); is called. The function onEnd is already defined:
this.onEnd = function () {
this.gotoAndPlay (2);
}
These functions can be defined in the hosting movie to e.g. stop the video.
Conversion without streaming sound
To avoid the streaming sound inside a flash movie (.swf) after conversion use the parameter nosound. This is useful eg. when building a snapshot application:
flv2swf.exe?i=input.flv&nosound=1
FAQ:
The program runs with Windows XP and the latest stable Apache Version 2.0.43 but not 100% reliable?
The problem is already known at the Apache Group, the problem can be alleviated with installation of Service Pack 1 for Windows XP.
Why doesn’t audio conversion work with the 8Khz soundformat?
The 8Khz soundformat is compressed with a special codec by Nellymoser, that was integrated inside the Macromedia Flash player. It wasn’t to this point possible for us to gain additional information to the SDK.
What privileges have to be set?
With each common FTP-program the privileges for the tool can be set, commonly they are to be found under the menu point CHMOD. Set the rights to 755.
With the calling of the flv2swf.exe in the Browser I get an Internal Server Error (500). Why is that?
When CGI is activated, the rights are most likely incorrectly given or the specified path to the CGI-BIN directory is false. This tool must always be called up with the parameter i (for the input file).
Where must the license file be stored?
In Order to activate the Demo version, the license files must also be stored in the CGI-BIN directory. After the next program start the logo should then no longer appear in the Flash Files (.swf).
With the loading of a video per loadMovie appear more variables than appear in the documentation?
This is due to the transfer of the URL-variables.
How can I change the volume of my Flash file (.swf) while it is playing?
The sound can be controlled over the Sound-Object, for that you have to pass the movieclip that contains the Flash file on like this:
sndCtrl = new Sound (mc);
sndCtrl.setVolume (50);
Problems with paths?
Backslash must be marked twice, always:
mc.loadMovie ("E:\\Webserver\\swfvideos\\output.swf");
What’s the .NET, ASP & Java interface look like?
Usage of FLV2SWF in .NET (C#) or ASP:
System.Diagnostics.Process.Start ("flv2swf.exe -i input.flv -o output.swf");
Inside Java:
Runtime.getRuntime().exec ("flv2swf.exe -i input.flv -o output.swf").waitFor();
How to load and stop video after end?
Example:
this.createEmptyMovieClip ("holder", 1);
this.holder.loadMovie ("video.swf");
this.onEnterFrame = function () {
if (this.holder._framesloaded > 1) {
this.holder.onEnd = function () {
this.stop();
};
delete this.onEnterFrame;
}
};
Imprint:
| Powerflasher GmbH |
| Belvedereallee 5 |
| D - 52070 Aachen |
| Fon: | +49 (0) 241 91880 - 230 |
| Fax: | +49 (0) 241 91880 - 230 |
| http://www.powerflasher.com |