The original version including explanations can be found here.
This repo contains build information on Windows as well as the updated and commented source files for the amazing tutorial by dranger, which is based on previous work by Martin Bohme and FFplay code examples that are part of FFmpeg. Some parts of the code were adapted from ffmpeg-video-player.
The files were tested to work with ffmpeg-4.3.1 and SDL2-2.0.12 using mingw as well as with ffmpeg-5.1.2 (you can use the prebuilt version for Windows ffmpeg-5.1.2-full_build-shared.(7z|zip)) and SDL2-2.24.1 (use SDL2-devel-2.24.1-VC.zip) with cl.exe distributed with VS2022.
See build_info.txt
on how to build the source files, which includes a very short outline
of how to build ffmpeg using mingw.
For the VC builds you can use build_vc.bat tut01.c
, which expects the ffmpeg
header files in ffmpeg-5.1.2-full_build-shared\include
and SDL2 headers in SDL2-2.24.1\include
.
Libs are assumed to be in ffmpeg-5.1.2-full_build-shared\lib
and SDL2-2.24.1\lib\x64
.
Since the ffmpeg libs are not completely static, you can then use run_with_dll_path.bat tut01.exe
to add the ffmpeg DLL location at ffmpeg-5.1.2-full_build-shared\bin
to the PATH and then
run the file.