BtbN / FFmpeg-Builds

MIT License
6.99k stars 958 forks source link

How to have ffplay without SDL2 after build? #310

Closed huangjinshe closed 8 months ago

huangjinshe commented 8 months ago

If we include ffplay, the size will increase to > 2MB. Is there anyway keep ffplay only 100KB around (original). then use with external SDL2.dll together?

huangjinshe commented 8 months ago

we could download SDL2.dll by ourselves. we just need a small size ffplay.

BtbN commented 8 months ago

You don't, the whole point of these builds is to have no non-OS external dependencies. If you want a build like that, you can try to modify the sdl build script, to not produce a static library, but a shared one. You will then have to extract the resulting SDL dll from the docker image.

Keep in mind that if you want to share that library with some other program, you need to be very sure about the ABI compatiblity of the two.

huangjinshe commented 8 months ago

Could you tell my why I'm getting error: sdl2 requested but not found

+ ./configure --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-opencl --disable-libpulse --disable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-libgme --enable-libmp3lame --enable-libvpx --enable-libvpl --enable-libopenh264 --enable-libopenjpeg --enable-sdl2 --enable-libtwolame --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags= --extra-ldexeflags= --extra-libs= --extra-version=20231022
ERROR: sdl2 requested but not found

I'm using source code from Auto-Build 2023-10-21 13:05, no matter I change it to shared from the SDL.sh or keep original config(not change anything) , it always show this error.

BtbN commented 8 months ago

You will have to look into the config.log to figure that out. But please be aware that I don't support building like that, so you need to figure out issues with your modifications yourself. The temporary build files are left behind in case of an error, so you can go in there and investigate.

huangjinshe commented 8 months ago

I did check, look like I should remove SDL.sh, but once I remove that I can't get ffplay.exe, so I did not remove SDL.sh, I directly changed it config to : DSDL_SHARED=ON, -DSDL_STATIC=OFF , but it still show: sdl2 requested but not found So I remove --enable-sdl2 in the bottom of SDL.sh, now no error, but also no ffplay.exe. So I replace --enable-sdl2 to --enable-ffplay, now no error, build finish , but still no ffplay.exe....

this time the temporary build file already deleted, but I'll continue try.

huangjinshe commented 8 months ago

I think if we need to enable ffplay without include the SDL2 we should install sdl2 directly into Ubuntu(not compile sdl2, just install it), and then don't enable sdl, just enable ffplay, but this is little complex...look like it required to modify the docker image