mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.24k stars 2.9k forks source link

how to load the c cplugin #15140

Open jsdfhasuh opened 1 day ago

jsdfhasuh commented 1 day ago

mpv Information

mpv v0.39.0-170-g37159a8e Copyright @ 2000-2024 mpv/MPlayer/mplayer2 projects
built on 0ct 20 2024 00:05:22
libplacebo version: v7.349.0 (v7.349.0-18-g9e16c86-dirty)
FFmpeg version: N-117613-g72e538112
FFmpeg library versions:
Libavcodec61.22.100
libavdevice61.4.100
libavfilter10.6.100
libavformat61.9.100
libavutil59.44.100
libswresample5.4.100
libswscale8.6.100

Other Information

- Windows version:
win 11

Reproduction Steps

my c code:\n image my task.json: \n image

Expected Behavior

it will print the mpv version

Actual Behavior

image can not load the c plungin

Log File

[test]C plugin error:‘找不到指定的程序。 [test] [test] Could not load cplugin script C:\Users\ddlo9\AppData\Roaming/mpv/scripts/test.d [auto_profiles] Applying auto profile: ontop-playback Resuming playback. This behavior can be disabled with --no-resume-playback. ●Video --vid=1 --vlang=en (h264 1920x1080 29.97 fps) [default] ●Audio--aid=1--alang=ja‘日语'(aac 2ch 48000 Hz)[default] Subs--sid=1--slang=zh‘简体中文’(subrip) O Subs--sid=22--slang=zh‘繁体中文’(subrip) Using hardware decoding (d3d1lva). AO:[wasapi] 44100Hz stereo 2ch float VO:[gpu] 1920x1080 d3d11[nv12] Saving state. (Paused) AV:00:00:09/ 00:54:11(0%) A-V:0.000 Exiting...(Quit)

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

kasper93 commented 1 day ago

How did you build/create test.dll? Could you explain what steps did you take in detail?

jsdfhasuh commented 1 day ago

How did you build/create test.dll? Could you explain what steps did you take in detail?

cmd /c chcp 65001>nul && "C:\Program Files\mingw64\bin\gcc.exe" C:\Users\dd109\Desktop\mpv-0.39.0\mpv-0.39.0\my_scripts\test.c -DMPV_CPLUGIN_DYNAMIC_SYM -I C:\Users\dd109\Desktop\mpv-0.39.0\mpv-0.39.0\ -shared -o C:\Users\dd109\Desktop\mpv-0.39.0\mpv-0.39.0\my_scripts\test.dll

kasper93 commented 11 hours ago

Make sure all dependencies of test.dll are in PATH or the same folder. This error message means that during loading of test.dll some its dependencies were not found.

jsdfhasuh commented 10 hours ago

Make sure all dependencies of test.dll are in PATH or the same folder. This error message means that during loading of test.dll some its dependencies were not found.

what dependencies it need? I include the "libmpv/client.h",and it compile no error message

jsdfhasuh commented 10 hours ago

Make sure all dependencies of test.dll are in PATH or the same folder. This error message means that during loading of test.dll some its dependencies were not found.

same scripts。 in ubuntu it work fine。the build command is "gcc -o simple.so simple.c -I /home/jsdfhasuh/mpv-build/mpv -shared -fPIC"

jsdfhasuh commented 10 hours ago

image

jsdfhasuh commented 5 hours ago

image maybe the error occur in dlopen, it can not find the scripts file.

Andarwinux commented 4 hours ago

Use llvm-readobj --needed-libs or something similar to check for DLL dependencies.