Top Features of FFVCL (Delphi FFmpeg VCL Components) and How to Use Them
FFVCL Tutorial: Integrating FFmpeg VCL Components in Delphi Projects
What FFVCL provides
- Native VCL components wrapping FFmpeg: FFEncoder (transcode), FFPlayer (playback), FFDecoder (file info/frames), FFLogger.
- Add-ons: Frame/Wave/Packet input-output adapters, GDICapture, DShowCapture, MemoryAccessAdapter.
- Hooks/events to modify frames/audio (OnVideoHook, OnFrameHook, OnAudioHook).
- Supports preview during encoding, multi-threaded encoding, batch jobs, overlays, filters, screen/webcam capture.
Quick setup (assumed Delphi 10.x or XE)
- Install FFVCL package for your Delphi version (use provided .dpk/.bpl).
- Add FFVCL runtime DLLs (FFmpeg libs included) to your executable folder or PATH.
- Drop components on form: FFPlayer for playback or FFEncoder for transcoding.
- Configure source and target: set InputFile/OutputFile or attach FrameInputAdapter/MemoryAccessAdapter.
- Wire events: OnProgress, OnVideoHook (modify TBitmap), OnAudioHook.
- Call Start/Play and handle Stop/Pause/Resume.
Example: play a video (minimal)
- Place TFFPlayer on form, set Player.FileName := ‘C:ideo.mp4’; then call Player.Play; handle OnPlayerError/OnProgress as needed.
Example: encode with overlay (high-level)
- Place TFFEncoder and configure Encoder.InputFiles.Add(‘in.mp4’); Encoder.OutputFile := ‘out.mp4’.
- Use OnVideoHook to draw overlay on provided TBitmap (text/image).
- Set desired codec options via Encoder.Options (similar to ffmpeg CLI switches).
- Call Encoder.Start; monitor OnProgress and FFLogger.
Common pitfalls & tips
- Match FFmpeg DLL versions shipped with the component pack.
- For webcam capture use DShowCapture and ensure device permissions/drivers.
- Large bitmaps/filters can increase memory — enable multi-threading cautiously.
- Use FrameOutputAdapter to get processed frames in your app.
- Consult shipped samples — they demonstrate encoding, hooks, capture, and adapter usage.
Where to find more
- Use the FFVCL package samples and docs included with the download (contains example projects for Encoder/Player/Adapters).
Leave a Reply