-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to initialize on linux #17
Comments
As mentioned in the README, you need to use libvlc 3.x.x |
Thanks for the quick reply! I did try this out earlier today, and got different errors. vlc: unknown option or missing mandatory argument EDIT: Same error on both Ubuntu 15.10 and 14.04 |
|
|
Oh, you know what, I know what it is. It's not finding your VLC plug-in modules. The Linux build rules are not yet configured in the VlcMedia module. I haven't had time yet to work on that. There's likely stuff missing in VlcMedia.Build.cs and Vlc.cpp. The plug-in directory is configured in VlcMediaModule.cpp The main issue is that I haven't figured out yet how to deal with VLC binaries on Linux. It is not clear what should be redistributed and how. It might be best to assume that libvlc is installed on the machine, although that may not be user friendly. If you have any ideas, please let me know. |
I've tried to hack it together on my end, but still no luck. in VlcMedia.Build.cs I added the following code:
and Vlc.cpp:
I added the executables and plugins built from VLC into the ThirdParty and ThirdParty/Linux/plugins folders in my engine source plugins folder along side the files you provide. The files do get copied over correctly during the build process. I am still stuck with the following error, with no other errors/warnings: [2016.04.10-22.26.08:923][ 0]LogVlcMedia:Warning: Failed to create VLC instance ((null)) Before trying all of this, I built VLC form source and did a make install. The correct version of VLC is installed on the PC, but it still errors out saying the executables are missing. |
We're still trying to get Linux support done and may look into it this week. |
I was able to get it working, but not in the most optimal way. I had to build VLC from source, then add symlinks to the project's binaries folder that point to the correct libs/execs in the installed directory in Linux. Ideally the correct libs/execs will be packaged with the project, but this workaround fits my needs (for now). |
The included libs were extracted from the i386 nightly build packages at https://launchpad.net/~videolan/+archive/ubuntu/master-daily/+packages #17
Thank you for the comments in #24. So, those comments and this issue got me much further, the plugin compiles, loads and seems to initialize. For the record, I resorted to compilation of vlc by hand as well. I can now play videos, however, they are rendered wrong, as in most of the time I get screen-fulls of solid green with occasional flickering of images that actually belong to the video. I wonder if @steyrboy has experienced this kind of artifact, or anyone else for that matter. I used vlc master branch and even tried it against ffmpeg tagged n3.1.3. I tried playing mjpeg and h264 encoded videos with the same results (both in the editor in "game"). I think it's still related to this issue... |
Using vlc-nightly from the AUR, then symlinked the files as @steyrboy mentioned got this running for me on Arch Linux. I get a green band at the bottom of the clips, regardless of format and video container. No sound is played (using the media sound wave uasset) either, with these errors logged: [2016.10.10-22.16.03:138][177]LogVlcMedia:Warning: Possible loss of audio quality due to sample rate != 44100 Hz |
I'm also hitting the VLC instantiation error stating: I'm using VLC binaries from the nightly builds of 10th Nov. 16 and 20. March 17 and try to resemble the Win or Mac folder within the plugins ThirdParty directory for Linux. I already tried it with a categorized plugin folder (like Win) and with a flat plugin folder (like Mac) as well as with a symlink to the install path of the nightly build snap of VLC as suggested by @steyrboy. So far all without success. Although libvlc.so and libvlccore.so are loading and all function pointers are initialized well. The call So I would highly appreciate any hints or help on this issue, especially on any of the following topics:
Thanks in advance for any advice. |
No, Linux is completely untested.
Agreed, but which distro/version shall we ship for?
|
@gmpreussner Many thanks for your hints and the great work on this project. I finally figured out form studying the libvlc unit tests that the |
I finally got it working for Linux and would like to share some of my findings. Logging and error reporting of vlc
to the Binary dependencies I hope this might be helpful for anybody and appreciate any comments or suggestions for possible improvements. |
You're right, the libvlc documentation is wrong. The correct log levels are: 0 = errors, 1 = warnings, 2 = debug. I'll fix it up.
Thanks, I will add this for Debug builds as well,
Yeah, we need more time to figure out Linux support in general. In the meantime, I recommend that developers perform this step manually just like you did. Thanks for looking into it! This is a good start. |
Alas I can't get the method outlined by jmuellerRFG to work on UE4Engine 4.17 sudo snap install vlc --edge (any channel--- they all seem to point same 2017-01-20 release) LD_LIBRARY_PATH=/snap/vlc/4/usr/lib/:/snap/vlc/4/lib/vlc/:/snap/vlc/4/usr/lib/x86_64-linux-gnu/:/snap/vlc/4/lib/x86_64-linux-gnu/:/snap/vlc/4/usr/lib/x86_64-linux-gnu/pulseaudio/ ./Engine/Binaries/Linux/UE4Editor Gives: [2017.07.26-09.02.12:540][ 0]LogLinux: Warning: dlopen failed: /home/user/Projects/UnrealEngine/Engine/Plugins/Media/VlcMedia/ThirdParty/vlc/Linux/x86_64-unknown-linux-gnu/libvlccore.so: cannot open shared object file: No such file or directory |
Hello @dodgyville, please be aware that loading of binary dependencies in this case happens in a sort of cascade and my guess from your logs would be that there is one level of it missing. It should work out like this:
The paths set in LD_LIBRARY_PATH are intended to provide the location of the vlc plugins (4) but the missing vlccore (3) your log is talking about is loaded from the VlcMedia-Plugin (2) which always expect this library in the path For shipping I included all the binary dependencies of libvlc into subfolders of this plugin in the final package. (See Directory Listing.) |
Thanks for your reply @jmuellerRFG - that got it working! Here's what I did to get it going on Ubuntu 17.04 in case someone else is reading this.
Then I added the following lines (relevant to my directory structure) to my ~/.bashrc
Open a new terminal (to pick up the changes in bashrc), run the engine, it should be good to go! |
I'd like to find a way for us to include all the required libraries in the VlcMedia plug-in itself. Then users can just download the latest VlcMedia release and be good to go. I don't want to be in the business of compiling VLC myself, so it would be best if we could just use the packages from the VLC Nightly Builds web site. Maybe we can extract the binaries from the snap package, put them into the ThirdParty directory and then add some logic to the Build.cs and Vlc.cpp to wire it all up correctly when packaging and at run-time. If anyone has any idea about how to best approach this, I'd love to hear from you. |
I can totally agree with this. Getting the binary dependencies in a more automated way would be great. But I would try to stick one version of VlcMedia to one defined version of libvlc rather than getting their latest build, as they might change interfaces and then things get out of sync. For me these scripts are working: So far I call the first one manually and the latter by an other script that generates the final package. But I guess it is also possible to integrate them into the Build.cs so that no further manual operation is required. Also I added the following to VlcMedia.Build.cs to get also the lib folder copied to the final package:
What I don't like on this approach is that it comes with it's own dependencies to the presence of the snap tools and files on the server of the vlc project. |
To install "VLC Daily Build of master branch" and build VlcMedia as a project plug-in for UE4.18.0 on Ubuntu 16.04.1 LTS I run bash script from my "Game" project folder: This solution (without binary dependencies in plug-in folder) works for me. |
Hi folks, it seems that the approach I described above to ship all required binary dependencies is not working properly for all distributions/configurations. What I did so far was to ship all of the following files:
I just dumped the files of the last category into a folder and added it to the |
I wish ue4 used ogg theora |
Got this working on a Gentoo box using similar approach as @Alexei-Kondratiev - with the difference of compiling latest vlc version from git repo (using vlc-9999 ebuild). |
Please also note that there is a bug in 4.18 that breaks all media playback in Shipping builds. It was fixed for 4.18.1 (https://github.com/EpicGames/UnrealEngine/commit/2f1c3e2a2933acd351c5ca260342f7d05df7fae3) |
Thanks for this hint. We are still using 4.16, so the issues I described are probably not related to this bug, but it's good to know about it. |
How to run VlcMedia plug-in on UE4.18.1 and Ubuntu 16.04 LTS:
// RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(VlcDirectory, "libvlc.so.5.5.0")));
Good luck! |
Please try Alexei's changes in the 4.19 plugin version, thanks! |
I've compiled libvlc.so and libvlccore.so from the 2.2.2 source, and I get this error when trying to load a project (running on linux):
[2016.04.07-03.32.42:711][ 0]LogVlcMedia:Warning: Failed to import VLC function libvlc_media_new_callbacks
[2016.04.07-03.32.42:711][ 0]LogVlcMedia:Warning: Failed to initialize libvlc
Any ideas? I'm running a fresh 4.11 (non-preview) source build.
The text was updated successfully, but these errors were encountered: