Pascal bindings for FFmpeg 8.1.x shared libraries (Windows), synced with upstream tag n8.1.1.
- Delphi 10.3 Rio or newer (verified on Delphi 13 Florence)
- Free Pascal 3.0.4+ (optional)
- FFmpeg 8.1.x shared DLLs for Windows (see below)
| Path | Description |
|---|---|
source/ |
Pascal units: libavcodec, libavformat, libavutil, … |
source/uFFmpegCodecUtils.pas |
Helpers (CodecStringFromParameters, encoder setup) |
source/uFFmpegPath.pas |
UTF-8 paths for FFmpeg C API |
examples/ |
Official FFmpeg API samples; open examples/Examples.groupproj |
sdl/ |
JEDI-SDL bindings (used by ffmpeg_sample_player) |
bin/win32/, bin/win64/ |
Build output and FFmpeg DLLs per platform |
bin/scripts/ |
DLL download scripts |
bin/out/ |
Example run / verification artifacts |
Version constants live in source/ffmpeg.inc (target n8.1.1). When auditing structs against a local tree, check out that tag: git -C C:\FFmpeg checkout n8.1.1.
- Open
examples/Examples.groupprojin Delphi. - Build All — search paths to
source/(andsdl/for the player) are set in each.dproj. - FFmpeg DLLs for the active platform are in
bin/win32/orbin/win64/(same folder as the built.exe).
cd examples
.\build_all.ps1 # Win64 (default)
.\build_all.ps1 -Platform Win32Download runtime DLLs:
cd bin/scripts
.\download_ffmpeg_dll.ps1 # Win64 — BtbN shared build → bin/win64/
.\download_ffmpeg_dll_win32.ps1 # Win32 — defisym shared build → bin/win32/Win32: bin/win32/ (defisym). Win64: bin/win64/ (BtbN). Each folder holds both DLLs and built .exe files.
Or build/install FFmpeg 8.1.x yourself and copy DLLs from the install bin/ folder.
Place DLLs next to the built .exe (bin/win32/ or bin/win64/). Scripts in bin/scripts/ fetch FFmpeg automatically; links below are for manual download.
| Platform | Archive | Project |
|---|---|---|
| Win32 | ffmpeg-n8.1-latest-win32-gpl-shared-8.1.zip | defisym/FFmpeg-Builds-Win32 |
| Win64 | ffmpeg-n8.1-latest-win64-gpl-shared-8.1.zip | BtbN/FFmpeg-Builds |
Copy bin\*.dll from the unpacked archive into bin/win32/ or bin/win64/.
Bindings expect SDL.dll (SDL 1.2; see sdl/sdl.pas). Source and build files: libsdl-org/SDL-1.2.
| Platform | Download | Notes |
|---|---|---|
| Win32 | SDL-1.2.15-win32.zip | Prebuilt SDL.dll |
| Win32 (alt.) | SDL-devel-1.2.15-VC.zip | MSVC package; SDL.dll in lib\ |
| Win64 | VisualC | No official Win64 runtime on libsdl.org; build SDL.dll from the VS solution |
Copy SDL.dll into bin/win32/ or bin/win64/ beside ffmpeg_sample_player.exe.
Bindings expect these library names (from source/ffmpeg.inc):
avcodec-62.dll,avformat-62.dll,avutil-60.dllavdevice-62.dll,avfilter-11.dllswresample-6.dll,swscale-9.dll
postproc-58.dll is optional legacy; it is not part of the FFmpeg 8.x source tree and is not required by the examples.
Delphi-OpenCV uses this project via the embedded copy at Delphi-OpenCV/Delphi-FFMPEG/ and the runtime package rtpFFMPEG. Keep both copies of source/ in sync when updating bindings.
Install order in OpenCV: rtpFFMPEG → rclVCLOpenCV → …
Related: Delphi-OpenCV5 — OpenCV 5.0 Delphi wrapper (Win64).
- Bindings follow the public FFmpeg API only (no
avpriv_*imports); inline helpers (av_mallocz_array, etc.) are implemented in Pascal. - Many legacy API symbols are deprecated in FFmpeg 8.x — compiler warnings W1000 are expected.
ffmpeg_sample_playerrequiresSDL.dll(SDL 1.2) in addition to FFmpeg DLLs — see Runtime DLL downloads.- Examples use
codecparandavcodec_send_packet/avcodec_receive_frame.