SWF To Video API ReferenceBytescout SWF To Video SDK

Bytescout SWF To Video ActiveX .NET API

Bytescout SWF To Video object provides set of methods and properties to convert SWF and FLV into video (WMV or AVI with sound) or image (PNG, BMP) from Visual Basic 6, C#, VB.NET, ASP.NET programming languages. Simple and easy to use!

General Information

Files: BytescoutSWFToVideo.dll and BytescoutSWFToVideoFilter.dll

.NET assembly: BytescoutSWFToVideoLib.dll

ActiveX object interface: BytescoutSWFToVideo.SWFToVideo

BytescoutSWFToVideo.ISWFToVideo: GUID = CDF4FDE0-E92D-48D3-8D9C-7E4689A3DD4A. This ActiveX object interface provides ready-to-use methods and properties to convert SWF, FLV into .AVI or .WMV video file.

  • Property Version As String: returns string with version of the SDK;

  • Property RegistrationName As String: set this property to your registration name when using FULL version of the SDK;

  • Property RegistrationKey As String: set this property to your serial key when using FULL version of the SDK;

  • Method SetLogFile(fileName As String): sets filename for the log to write the conversion log;

  • INPUT AND OUTPUT

  • Property InputSWFFileName As String: sets input .SWF flash movie filename. You can also set URL (for example: http://bytescout.com/demo/swfscout_VideoSample.swf )

  • Property OutputVideoFile As String: sets output video filename (REQUIRED FOR SWF To VIDEO conversion only). You can set .AVI or .WMV filename;

  • Property OutputVideoFile As String: sets output video filename (REQUIRED FOR SWF To VIDEO conversion only). You can set .AVI or .WMV filename;

  • SWF TO IMAGE METHODS AND PROPERTIES

  • Method ConvertToPNG(fileName As String): converts given frame (see .StartFrame) from input SWF (see .InputSWFFileName) into PNG image file.

    If you set filename to "" (empty string) then SDK saves output BMP into .BinaryImage() property (as an array of bytes);

    To convert into PNG with transparency set .RGBAMode property to TRUE before setting input SWF filename through .InputSWFFileName;

  • Method ConvertToBMP(fileName As String): converts given frame (see .StartFrame) from input SWF (see .InputSWFFileName) into BMP image file.

    If you set filename to "" (empty string) then SDK saves output BMP into .BinaryImage() property (as an array of bytes);

  • Method ConvertAllToPNG(folderName As String): converts set of frames (from .StartFrame to .StopFrame) from input SWF (see .InputSWFFileName) into a set of PNG image files in the given folder path.

    To convert into PNG with transparency set .RGBAMode property to TRUE before setting input SWF filename through .InputSWFFileName;

  • Method ConvertAllToBMP(folderName As String): converts set of frames (from .StartFrame to .StopFrame) from input SWF (see .InputSWFFileName) into a set of BMP image files in the given folder path.

  • Property BinaryImage As OLE_VARIANT: returns output image as array of bytes.

    IMPORTANT: Run .ConvertToBMP or .ConvertToPNG method before!;

  • Property BinaryImageSize As long: returns size of output bytes array of output PNG or BMP image (see .BinaryImage property).

    IMPORTANT: Run .ConvertToBMP or .ConvertToPNG method before!;

  • SWF TO VIDEO METHODS AND PROPERTIES

  • Property SWFConversionMode As SWFConversionModeType: sets conversion mode (default is SWFAnimation = 0).

    Available values:

    • SWFAnimation = 0 (default): converts SWF to video in frame-by-frame mode. Works OK for SWF animations without sound and live or remote data. NO SOUNDin this mode (but you can set WAV or MP3 sound track from file using .ExternalAudioTrackFromFileName property).

    • SWFWithLiveData = 1: converts SWF to video in real-time mode. To convert with sound in this mode please make sure .SoundRecordingEnabled = True.

  • Property ConversionTimeOut As Long: sets conversion timeout in milliseconds. Default value is 0 (zero) and the SDK tries to determine the flash movie length using number of frames in the source flash movie. If you need to convert movie with dynamic data (video, xml, images etc) then you need to use this property and set the conversion timeout.

  • Property UseConversionTimeoutFor1FrameSWFOnly As Boolean: set to True to enable ConversionTimeout for 1 frame SWF flash movies only;

  • Method Run: runs the conversion and exits immediately (you should call the .Stop() method to stop the conversion later);

  • Method RunAndWait: method runs the conversion and waits until the conversion is done;

  • Property IsRunning: returns the status of conversion: True if conversion is running, False if the conversion is not running;

  • Method Stop: stops the conversion (if the conversion has been started with .Run() method);

  • Property VideoCodecsCount AS Long: returns number of available AVI video codecs installed on the current computer;

  • Method GetVideoCodecName(Index As Long): returns the name of the AVI video codec by its index in the available video codecs list;

  • Property CurrentVideoCodec As Long: read or write the index of the currently selected AVI codec in the list of available video codecs;

  • Property CurrentVideoCodecName As String: reads or writes current video codec name. If you want to set current video codec by its name (or part of the name, say, DivX) then you should use this property;

  • Property WMVVideoCodecsCount AS Long: returns number of available WMV video codecs installed on the current computer;

  • Method GetWMVVideoCodecName(Index As Long): returns the name of the WMV video codec by its index in the available video codecs list;

  • Property CurrentWMVVideoCodec As Long: read or write the index of the currently selected WMV codec in the list of available video codecs;

  • Property CurrentWMVVideoCodecName As String: read or write currently selected WMV video codec by its name;

  • Property WMVVideoBitrate As Long: WMV video codec bitrate;

  • Property OutputWidth As Long: read or write output video width;

  • Property OutputHeight As Long: read or write output video height;

  • Property FPS As Float: read write FPS (frames per second) for the output video;

  • Method ShowVideoCodecSettingsDialog(OLE_HANDLE parent) As HRESULT: shows video codec settings dialog (for the currently selected AVI video codec);

  • INPUT SWF PROPERTIES

  • Property RGBAMode As Bool: enables RGBA (32-bit video with transparency) mode for output video. IMPORTANT: if you need to use 32-bit mode you should set .RGBAMode = True BEFORE setting .InputSWFFileName property!;

  • Property FrameCount As Long: returns number of frames in the swf flash movie loaded previously with .InputSWFFileName property;

  • Property BackgroundColor As String: read-write background color for input SWF flash movie in the RRGGBB form. Set to an empty string to use default background color;

  • Property MovieScale As String: read-write movie scale for input flash SWF movie. Supported scaling values are: ShowAll, NoBorder, ExtactFit, NoScale, Low, AutoLow, AutoHigh, High, Best, AutoMedium, Medium;

  • Property MovieAlign As String: read-write movie align for input swf flash movie. Controls aligning of the flash movie. You can use L,T,R,B to align movie to Left, Top, Right or Bottom. You can use combinations: LR, LT, TR, LTR, LB, RB, LRB, TB, LTB, TRB, LTRB;

  • Property MovieWidth As Long: reads the width of the source swf flash movie. The swf is rendered with this size and then scales into the width for the output video width;

  • Property MovieHeight As Long: reads the height of the source swf flash movie. The swf is rendered with this size and then scales into the width for the output video width;

  • Method SetVariable(name As String, value As String): set a variable to the given value and passes to flash movie. IMPORTANT: call this method after calling .SetMovie() method not before!

  • Method GetVariable(name As String) As String: gets a variable with a given name and returns its value value. IMPORTANT: call this method after calling .SetMovie() method not before!

  • Property FlashVars As String: sets parameters for a flash movie in the form of "variable1=value1&variable2=value2" (in the same way as variables are passed from URL in browser). IMPORTANT: call this method after calling .SetMovie() method not before!

  • Property StartFrame As Long: sets index of the frame to start from. Default is 0 (zero), the very first frame;

  • Property StopFrame As Long: sets index of the frame to stop and end the conversion. Default value the last frame of the swf flash movie (if ConversionTimeout is set to zero);

  • Property StartFrameLabel As String: sets label name of the frame to start from;

  • Property StopFrameLabel As String: sets label name of the frame to stop and end the conversion. Default value the last frame of the swf flash movie (if ConversionTimeout is set to zero);

  • Property Timeline As String: sets timeline for a source flash swf movie. Default is the empty string;

  • AUDIO SETTINGS (for swf to video conversion)

  • Property SoundRecordingEnabled As Boolean: use this property to enable/disable audio conversion. True by default. This setting applies to SWFWithLiveData conversion mode only (see .SWFConversionMode);

  • Property ExternalAudioTrackFromFileName As String: use this property to set the external audio track filename (.wav or .mp3) which will be merged in the output video automatically. Can be used in both SWFAnimation and SWFWithLiveData conversion modes (see .SWFConversionMode);

  • Read-only Property AudioCodecsCount As Long: returns number of available AVI audio compression codecs installed on the current computer.

  • Method GetAudioCodecName(Index As Long) As String: returns name of the AVI audio codec selected by the index.

  • Property CurrentAudioCodec As Long: set or get currently selected AVI audio compression codec (which is used to compress audio in the captured video).

  • Property CurrentAudioCodecName As String: set or get currently selected AVI audio compression codec using audio codec name (which is used to compress audio in the captured video).

  • Read-only Property WMVAudioCodecsCount As Long: returns number of available WMV audio compression codecs installed on the current computer.

  • Method GetWMVAudioCodecName(Index As Long) As String: returns name of the WMV audio codec selected by the index.

  • Property CurrentWMVAudioCodec As Long: set or get currently selected WMV audio compression codec (which is used to compress audio in the captured video).

  • Property CurrentWMVAudioCodecName As String: set or get currently selected WMV audio compression codec using audio codec name (which is used to compress audio in the captured video).

  • Property WMVAudioFormatCount As Long: get number of available WMV audio codec audio formats;

  • Property CurrentWMVAudioFormat As Long: set or get currently selected WMV audio compression codec audio format;

  • Method GetWMVAudioFormatDescription(Index as Long) As String: returns description for the WMV audio format by its index;

  • Read-only Property AudioDeviceCount As Long: returns number of available audio devices installed on the current computer.

  • Method GetAudioDeviceName(Index As Long) As String: returns name of the audio device selected by the index.

  • Property CurrentAudioDevice As Long: set or get currently selected audio device (which is used to recird audio from in the captured video).

  • Property CurrentAudioDeviceName As String: set or get currently selected device line using audio line name (which is used to record audio from in the captured video).

  • Read-only Property CurrentAudioDeviceLinesCount As Long: returns number of available audio lines installed on the current computer.

  • Method GetCurrentAudioDeviceLineName(Index As Long) As String: returns name of the audio line selected by the index.

  • Property CurrentAudioDeviceLine As Long: set or get currently selected audio line (which is used to recird audio from in the captured video).

  • Property CurrentAudioDeviceLineName As String: set or get currently selected audio line using audio line name (which is used to record audio from in the captured video).

  • Property OverlayingRedTextCaption As String: set this property to text if you want it to appear as the watermark of the output;

  • Method SetLiveWindowPos(LONG left, LONG top): set coordinates to show interactive flash player window if you need to convert interactive SWF or FLV movies;

using System.Diagnostics;
using BytescoutSWFToVideoLib;

namespace Simple
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create an instance of SWFToVideo ActiveX object

            SWFToVideo converter = new SWFToVideo();

            // Set debug log
            //converter.SetLogFile("log.txt");

            // Register SWFToVideo
            converter.RegistrationName = "demo";
            converter.RegistrationKey = "demo";

            // set input SWF file
            converter.InputSWFFileName = "SlideShowWithEffects.swf";

                // set output WMV or AVI video filename
                converter.OutputVideoFileName = "result.wmv";


            // Set output movie dimensions
            converter.OutputWidth = 640;
            converter.OutputHeight = 480;

            // Run conversion
            converter.RunAndWait();

            // Open the result movie in default media player
            Process.Start("result.wmv");
        }
    }
}