Kurento自定义模块异常:未实际安装却在kurento-media-server --list中显示
Hey there, let's tackle this tricky issue with your Kurento Media Server custom module—it's strange that kurento-media-server --list shows your module, but it's not actually working as expected. Let's walk through step-by-step checks to get to the bottom of this:
1. Verify the module's shared library is installed in the correct path
Kurento loads modules from a standard system directory. For most 64-bit systems, this is /usr/lib/x86_64-linux-gnu/kurento/modules/. Run this command to check if your library is present:
ls /usr/lib/x86_64-linux-gnu/kurento/modules/ | grep bgRemoverFilterOpenCV
If the .so file is missing, your Debian package didn't install it properly. Double-check your debian/install file to ensure it's copying the compiled library to the correct location (it should look something like src/server/build/libbgRemoverFilterOpenCV.so usr/lib/x86_64-linux-gnu/kurento/modules/).
2. Check the module descriptor file
Kurento relies on .kmd.json descriptor files to recognize and load modules. This file should be placed in /usr/share/kurento/modules/. Verify it exists with:
ls /usr/share/kurento/modules/ | grep bgRemoverFilterOpenCV
If the descriptor is missing, your packaging setup is omitting it. The descriptor defines your module's components (like filters) and their interfaces—without it, Kurento can't properly initialize your module even if the library is present.
3. Inspect Kurento's runtime logs for errors
This is often the most revealing step. View real-time logs while restarting the server to catch loading issues:
journalctl -u kurento-media-server -f
Then restart the server:
systemctl restart kurento-media-server
Look for lines mentioning your module—common issues here include:
- Undefined symbols (if you forgot to link against OpenCV or other dependencies)
- Failed to load the shared library
- Invalid JSON in the descriptor file
4. Ensure your code changes are actually compiled into the library
Sometimes debuild uses cached build artifacts instead of rebuilding from scratch. Clean and rebuild your package to rule this out:
debuild clean debuild -us -uc
You can also verify your "Hello World" code is present in the library with:
nm -D /usr/lib/x86_64-linux-gnu/kurento/modules/libbgRemoverFilterOpenCV.so | grep -i hello
If the string or related symbols don't show up, your code wasn't compiled into the library—check your CMake configuration or build scripts to ensure the bgRemoverFilterOpenCVImpl.cpp is included in the build.
5. Confirm Kurento is attempting to load your module
Use strace to track file operations and see if Kurento tries to access your module's files:
strace -e open kurento-media-server 2>&1 | grep bgRemover
If you don't see any lines referencing your library or descriptor, Kurento isn't aware of the module's existence—this points to a missing or misconfigured descriptor file.
6. Double-check your implementation code
Wait a second—you added code to draw "Hello World" text, but did you hook it into the right part of the filter's pipeline? Make sure you're overriding the correct method (like processFrame for frame processing) instead of putting the code in a constructor or unused method. If the code isn't executing when the filter processes media, it won't produce the expected result even if the module loads correctly.
Start with the log checks and file presence verifications—those usually uncover the root cause quickly. Let me know what you find!
内容的提问来源于stack exchange,提问作者OrlandoAlmario

