![]() |
![]() |
![]() |
| About | FLV Encoder SDK | Download | Buy now! | Support |
|
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 Back to top | Ask a question
How it works
Prepare a FTFLVSTREAMINFO structure:
[ 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);
[ 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);
[ C++ ]
ftFlvStreamPutAudioData(hFlvStream, lpAudioData, nLen, nTimeStamp); Destroy the video encoder and flv stream:
[ C++ ]
Back to top | Ask a question
ftScreenVideoEncoderDestroy(hScreenVideoEncoder); ftFlvStreamDestroy(hFlvStream);
|
|
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 |