logotype

What is FLV Encoder SDK?

FLV Encoder SDK is a developer tool (DLL) to create Flash Video Files (FLV).

FLV Encoder SDK is able to create FLV, you can write it to a file or to a stream. With FLV Encoder SDK you can convert a media file (AVI, MPEG and so on) to a FLV file. If you can play a media file in Media Player (for example), FLV Encoder SDK can convert it to FLV file. FLV Encoder SDK uses uncompressed audio and Screen Video Encoder to compress video.

Download

Download FLV Encoder SDK demo version

Purchase a license

Buy FLV Encoder SDK license

Back to top | Ask a question

How it works

  1. Prepare a FTFLVSTREAMINFO structure
  2. Prepare Screen Video Encoder
  3. Compress (encode) and write video data
  4. Write raw audio data
  5. Destroy the video encoder and flv stream

Prepare a FTFLVSTREAMINFO structure:

[ Download sample code ]

[ C++ ]
void CALLBACK WriteCallback(LPVOID lpParam, LPCVOID lpData, DWORD nLen)
{
	WriteFile((HANDLE)lpParam, lpData, nLen, NULL);
}

...

FTVIDEOINFO video_info;

video_info.dwCodec = FT_VIDEOCODEC_SCREENVIDEO;
video_info.dwWidth = 0x100;
video_info.dwHeight = 0x100;

FTAUDIOINFO audio_info;

audio_info.dwFormat = FT_SOUNDFORMAT_UNCOMPRESSED;
audio_info.dwRate = FT_SOUNDRATE_44KHZ;
audio_info.dwSize = FT_SOUNDSIZE_16BIT;
audio_info.dwType = FT_SOUNDTYPE_STEREO;

FTFLVSTREAMINFO info;

// if you don't want to place any video into a flv, you can pass NULL
info.lpVideoInfo = &video_info;
// if you don't want to place any audio into a flv, you can pass NULL
info.lpAudioInfo = &audio_info;

info.lpWriteDataCallback = &WriteCallback;

HANDLE hFLVFile = CreateFile( ... );

info.lpParam = hFLVFile;

HFTFLVSTREAM hFlvStream = ftFlvStreamCreate(&info);

Prepare Screen Video Encoder:

[ C++ ]
HFTSCREENVIDEOENCODER hScreenVideoEncoder = ftScreenVideoEncoderCreate(0x100, 0x100, 16);

Compress (encode) and write video data:

[ C++ ]
// OnVideoData(const char* data, unsigned int size, unsigned int timestamp)

LPCVOID lpData = 0;
DWORD cbBytes = 0;

ftScreenVideoEncodeFrame(hScreenVideoEncoder, data, size);
ftScreenVideoGetEncodedFrame(hScreenVideoEncoder, &lpData, &cbBytes);
ftFlvStreamPutVideoData(hFlvStream, lpData, cbBytes, timestamp);

Write raw audio data:

[ C++ ]
ftFlvStreamPutAudioData(hFlvStream, lpAudioData, nLen, nTimeStamp);

Destroy the video encoder and flv stream:

[ C++ ]
ftScreenVideoEncoderDestroy(hScreenVideoEncoder);
ftFlvStreamDestroy(hFlvStream);

[ Download sample code ]

Back to top | Ask a question

Copyright © 2004 – 2007 Softanics. All rights reserved.
Delphi is a trademark of Borland Software Corporation. Macromedia and Shockwave Flash are trademarks of Macromedia, Inc.
Designed by SoftFacade