Code Samples - Solid FFmpeg ActiveX Wrapper


C# Sample - Solid FFmpeg ActiveX Wrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

CAVConverter converter = null;
converter = new CAVConverter(); //Create the converter
converter.SetLicenseKey("Demo", "Demo"); //Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
converter.LogPath = @"C:\Log\Log.txt"; //Set the log path. If the log path is null, no log output
converter.OutputOptions.FrameSize = "640x480"; //Set output video frame size
converter.OutputOptions.VideoBitrate = 2000000; //Set output video bitrate
converter.AddTask(@"C:\SampleVideos\Wildlife.wmv", @"C:\SampleVideos\Wildlife-new.mp4"); //Add convert task

converter.StartAndWait(); //Start convert and wait for complete

converter = null;

 

VB.Net Sample - Solid FFmpeg ActiveXWrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

Dim converter As CAVEditLib.CAVConverter

converter = New CAVEditLib.CAVConverter 'Create the coverter
converter.SetLicenseKey("Demo", "Demo") 'Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
converter.LogPath = "C:\Log\log.txt" 'Set the log path. If the log path is null, no log output
converter.OutputOptions.FrameSize = "640x480" 'Set output frame size
converter.OutputOptions.VideoBitrate = 2000000 'Set output video bitrate
converter.AddTask("C:\Users\Public\Videos\SampleVideos\Wildlife.wmv", "C:\Users\Public\Videos\Sample Videos\Wildlife-new.mp4") 'Add a conert task
converter.StartAndWait() 'Start convert and wait for completed
converter = Nothing 'Free the converter

ASP - VBScript Sample - Solid FFmpeg ActiveXWrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

set converter = Server.CreateObject("CAVEditLib.CAVConverter") 'Create the converter
converter.SetLicenseKey("Demo", "Demo") 'Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
converter.LogPath = "C:\Log\log.txt" 'Set the log path. If the log path is null, no log output
converter.OutputOptions.FrameSize="640x480" 'Set output frame size
converter.OutputOptions.VideoBitrate=2000000 'Set output video bitrate rate
converter.AddTask "D:\Websites\ConverterASP\test\Wildlife.wmv", "D:\Websites\ConverterASP\test\Wildlife-new.mp4" 'Add a convert task
converter.StartAndWait 'Start and wait convert complete
set converter = nothing 'Free the converter


ASP.net Sample - Solid FFmpeg ActiveXWrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

conv = New CAVEditLib.CAVConverter 'Create the coverter
converter.SetLicenseKey("Demo", "Demo") 'Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
converter.LogPath = "C:\Log\log.txt" 'Set the log path. If the log path is null, no log output
converter.OutputOptions.FrameSize = "640x480" 'Set output frame size
converter.OutputOptions.VideoBitrate = 2000000 'Set output video bitrate
converter.AddTask("C:\\SampleVideos\Wildlife.wmv", "C:\SampleVideos\Wildlife-new.mp4") 'Add a conert task
converter.StartAndWait() 'Start convert and wait for completed
converter = Nothing 'Free the converter

VB6 Sample - Solid FFmpeg ActiveXWrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

Dim converter As Object
converter = Microsoft.VisualBasic.CreateObject("CAVEditLib.CAVconvertererter") 'Create the convertererter
converter.SetLicenseKey("Demo", "Demo") 'Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
converter.LogPath = "D:\\Log.txt" 'Set the log path. If the log path is null, no log output
converter.OutputOptions.FrameSize = "640x480" 'Set output video frame size
converter.OutputOptions.VideoBitrate = 2000000 'Set output video bitrate
converter.AddTask("C:\SampleVideos\Wildlife.wmv", "C:\Sample Videos\Wildlife-new.mp4") 'Add converterert task

converter.StartAndWait() 'Start converterert and wait for complete

converter = Nothing 'Free the convertererter

 

MFC Sample - Solid FFmpeg ActiveX Wrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

CoInitialize(NULL);

CCAVConverter converter = NULL;
CCOutputOptions outputOptions = NULL;

if (converter.CreateDispatch(_T("CAVEditLib.CAVConverter")))
{
converter.SetLicenseKey(_T("Demo"), _T("Demo")); //Set the license key. If the liscense key is invalid, only 7 days or 30 times to evaluate
converter.put_LogPath(_T("C:\\Log\\Log.txt")); //Set the log path. If the log path is null, no log output
outputOptions = converter.get_OutputOptions(); //get output options
outputOptions.put_FrameSize(_T("640x480")); //set output frame size
outputOptions.put_VideoBitrate(2000000); //set outptu video bitrate
converter.AddTask(_T("C:\\Users\\Public\\Videos\\Sample Videos\\Wildlife.wmv"), _T("E:\\test.mp4")); //add convert task
converter.StartAndWait(); //start convert and wait for complete
outputOptions.ReleaseDispatch(); //release the output options object
converter.ReleaseDispatch(); //release the convert object
}

CoUninitialize();

VC++ Sample - Solid FFmpeg ActiveX Wrapper

Note: Please add reference of Solid FFmpeg ActiveX Wrapper Library first         Back to Top

CoInitialize(NULL);

HRESULT hr = S_OK;
ICAVConverter * pConverter = NULL;
ICOutputOptions * pOutputOptions = NULL;
BSTR seed = NULL;
BSTR liscenseKey = NULL;
BSTR frameSize = NULL;
BSTR logPath = NULL;
BSTR inFileName = NULL;
BSTR outFileName = NULL;

hr = CoCreateInstance(CLSID_CAVConverter, NULL, CLSCTX_INPROC, IID_ICAVConverter, (void**)&pConverter);
hr = pConverter->get_OutputOptions(&pOutputOptions); //get output options

seed = SysAllocString(_T("Demo"));
liscenseKey = SysAllocString(_T("Demo"));
pConverter->SetLicenseKey(seed, liscenseKey); //Set the license key. If the license key is invalid, only 7 days or 30 times to evaluate
SysFreeString(seed);
SysFreeString(liscenseKey);

logPath = SysAllocString(L"C:\\Log\\log.txt");
hr = pConverter->put_LogPath(logPath); //Set the log path. If the log path is null, no log output
SysFreeString(logPath);

frameSize = SysAllocString(L"640x480");
hr = pOutputOptions->put_FrameSize(frameSize); //set output frame size
SysFreeString(frameSize);
hr = pOutputOptions->put_VideoBitrate(2000000); //set output video bitrate

hr = pConverter->put_LogLevel(cllInfo);

inFileName = SysAllocString(L"C:\\Users\\Public\\Videos\\Sample Videos\\Wildlife.wmv");
outFileName = SysAllocString(L"E:\\Wildlife.mp4");
hr = pConverter->AddTask(inFileName, outFileName); //add convert task
SysFreeString(inFileName);
SysFreeString(outFileName);

hr = pConverter->StartAndWait(); //start convert and wait for complete

if (pOutputOptions != NULL)
{
pOutputOptions->Release();
}
if (pConverter != NULL)
{
pConverter->Release();
}

CoUninitialize();