ByteScout SWF To Video SDK - C++ - SWF To WEBM - ByteScout

ByteScout SWF To Video SDK – C++ – SWF To WEBM

  • Home
  • /
  • Articles
  • /
  • ByteScout SWF To Video SDK – C++ – SWF To WEBM

SWF to WEBM in C++ with ByteScout SWF To Video SDK

Write code in C++ to make SWF to WEBM with this How-To tutorial

Every ByteScout tool contains example C++ source codes that you can find here or in the folder with installed ByteScout product. SWF to WEBM in C++ can be implemented with ByteScout SWF To Video SDK. ByteScout SWF To Video SDK is the library that can take SWF (Flash Macromedia) files and convert into WMV or AVI video with sound. Dynamic flash movie scenes, variables, actionscripts are supported and you also may adjust output video size, framerate and quality.

You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. In order to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. Enjoy writing a code with ready-to-use sample C++ codes to implement SWF to WEBM using ByteScout SWF To Video SDK.

ByteScout SWF To Video SDK free trial version is available for download from our website. Free trial also includes programming tutorials along with source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Simple.cpp
      
#include "stdafx.h" #import "BytescoutSWFToVideo.dll" using namespace BytescoutSWFToVideo; int _tmain(int argc, _TCHAR* argv[]) { ::CoInitialize(0); // Create an instance of SWFToVideo ActiveX object CLSID clsid; CLSIDFromProgID(OLESTR("BytescoutSWFToVideo.SWFToVideo"), &clsid); ISWFToVideo* swfToVideo = NULL; ::CoCreateInstance(clsid, NULL, CLSCTX_ALL, __uuidof(ISWFToVideo), (LPVOID*) &swfToVideo); if (!swfToVideo) { _ftprintf(stdout, _T("SWF To Video filter is not installed properly. Can't continue\n")); ::CoUninitialize(); return 1; } // Set debug log //swfToVideo->SetLogFile("log.txt"); // Register SWFToVideo swfToVideo->put_RegistrationName(L"demo"); swfToVideo->put_RegistrationKey(L"demo"); // set input SWF file swfToVideo->put_InputSWFFileName(L"SlideShowWithEffects.swf"); // you may calculate output video duration using information about the the source swf movie // WARNING #1: this method to calculate the output video duration is not working for movies with dynamic scenes //and interactive scripts as in these movies it is not possible to calculate the precise duration of the movie //WARNING #2: you should set the input swf or flv filename (or url) before this calculation //So the movie duration is calculated as the following: //as swf frame count (number of frames in the swf) / movieFPS (frames per second defined in swf) //and then multiplied by 1000 (as we are setting the .ConverstionTimeout in milliseconds) //as the following (uncomment if you want to set the length of the output video to the same as the original swf) //or as the following source code (uncomment to enable): //converter->put_ConversionTimeout( 1000 * (converter->get_FrameCount() / converter.get_MovieFPS())); // set output WMV, WEBM or AVI video filename swfToVideo->put_OutputVideoFileName(L"result.webm"); // Set output movie dimensions swfToVideo->put_OutputWidth(640); swfToVideo->put_OutputHeight(480); // Run conversion HRESULT hr = swfToVideo->RunAndWait(); // Cleanup swfToVideo->Release(); swfToVideo = NULL; ::CoUninitialize(); return 0; }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page

Explore ByteScout SWF To Video SDK Documentation

Explore Samples

Sign Up for ByteScout SWF To Video SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

stdafx.cpp
      
// stdafx.cpp : source file that includes just the standard includes // Simple.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page

Explore ByteScout SWF To Video SDK Documentation

Explore Samples

Sign Up for ByteScout SWF To Video SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

stdafx.h
      
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows XP or later. #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. #endif #include <stdio.h> #include <tchar.h> #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit #include <atlbase.h> #include <atlstr.h> #include <conio.h>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page

Explore ByteScout SWF To Video SDK Documentation

Explore Samples

Sign Up for ByteScout SWF To Video SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout SWF To Video SDK Home Page

Explore ByteScout SWF To Video SDK Documentation

Explore Samples

Sign Up for ByteScout SWF To Video SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next