Ffvcl - Delphi Ffmpeg Vcl Components 5.0.1 Repack
Review: FFVCL 5.0.1
Memory leak on application exit
Solution: Call FFMediaPlayer1.Close and FFVCL_Cleanup before Application.Terminate. The 5.0.1 documentation includes a proper shutdown sequence.
Documentation
- Add "Prepare" section to README with examples:
- Synchronous example
- Asynchronous example with progress event
- Handling ErrorCode and fallbacks
- Notes about ProbeOnly and HWAccel behavior
Internal Behavior
- Open input with avformat_open_input (fast flags: AVFMT_FLAG_IGNIDX optional).
- Call avformat_find_stream_info with limited probe size derived from TimeoutMs and ProbeOnly.
- For each stream, gather codec parameters (codec_id, profile, level, pix_fmt, sample_fmt, channels, sample_rate, extradata).
- Verify decoder availability via avcodec_find_decoder and check hardware-accelerated decoder mapping.
- If HWAccel requested, attempt to initialize hwdevice_ctx for requested backend; fall back to software if unavailable and record warning.
- Determine whether pixel/sample format matches component rendering/processing capabilities; set RequiresSoftwareConversion accordingly and propose RecommendedPixelFormat.
- If ProbeOnly = False, allocate minimal required buffers (small frame/audio pool), reserve internal decoder contexts but do not start decoding.
- Validate container-level issues (encryption, corrupt headers) and return clear ErrorMessage/ErrorCode mapping.
- Timeouts and cancellation support for long probes; background thread cooperates with main thread for event callbacks.
4. Real-time Streaming Encoder
Capture your screen (using TFFScreenCapture) or a camera device, encode to H.264, and push to an RTMP server (YouTube Live or Twitch). FFVCL 5.0.1 includes RTMP muxing support. FFVCL - Delphi FFmpeg VCL Components 5.0.1
Cons
- VCL Only (Windows): This is the biggest limitation. It relies heavily on the Windows API and VCL structures. If you are looking to build a cross-platform app using FireMonkey (FMX) for macOS, iOS, or Android, FFVCL is not the right tool. You would need to look at alternatives or roll your own solution.
- License Cost: It is a commercial library. While the time saved often justifies the cost, it is a barrier for hobbyists or small indie projects compared to free/open-source headers.
- Binary Dependency: You must distribute specific FFmpeg DLLs (
avcodec, avformat, etc.) with your application. Managing the correct versions of these DLLs is critical, as mismatched versions will cause immediate crashes.