caprica / vlcj-lwjgl-demo

Demo application embedding a vlcj media player in a LWJGL application
GNU General Public License v3.0
14 stars 6 forks source link

No video playback in demo app with latest vlcj changes #3

Closed rafalniski closed 2 years ago

rafalniski commented 2 years ago

Issue: Demo app is showing a black screen without video content, the audio is playing correctly.

System: Reproduced on OS X 12.2.1 and Ubuntu 20.04

Stacktrace: libva info: VA-API version 1.7.0 libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [00007f019c121660] decdev_vaapi_drm decoder device error: vaInitialize: unknown libva error

[00007f019c07b870] main video output error: video output display creation failed [h264 @ 0x7f019836a500] get_buffer() failed [h264 @ 0x7f019836a500] thread_get_buffer() failed [h264 @ 0x7f019836a500] decode_slice_header error [h264 @ 0x7f019836a500] no frame!

Dependencies used: I locally use latest master branch changes for vlcj-natives and vlcj: implementation files('/home/parallels/IdeaProjects/vlcj-natives/target/vlcj-natives-5.0.0-SNAPSHOT.jar') implementation files('/home/parallels/IdeaProjects/vlcj/target/vlcj-5.0.0-SNAPSHOT.jar')

VLC version: vlc_4.0.0-dev-19513-gf7434e60fc_amd64

LWJGL version: 3.3.1

Video used:

https://user-images.githubusercontent.com/1895719/171008278-399b31f8-2308-4e5d-8c75-2a7a9d6ef3dc.mp4

@caprica Any idea what I might be missing?

caprica commented 2 years ago

Last time I checked, this worked for me on Linux Mint 20.1.

The libva error looks like a problem with your local environment tbh.

rafalniski commented 2 years ago

I just noticed that on OS X I can see additional errors around VLC plugins missing:

[00007ff7b72d5f58] main generic error: cannot load plug-in /Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib: dlopen(/Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib, 0x0001): Library not loaded: @rpath/Sparkle.framework/Versions/A/Sparkle

  Referenced from: /Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib
  Reason: tried: '/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home/bin/./Sparkle.framework/Versions/A/Sparkle' (no such file), '/System/Library/Frameworks/Sparkle.framework/Versions/A/Sparkle' (no such file)

[00007ff7b72d6048] main generic error: cannot load plug-in /Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib: dlopen(/Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib, 0x0001): Library not loaded: @rpath/Sparkle.framework/Versions/A/Sparkle

  Referenced from: /Applications/VLC.app/Contents/Frameworks/plugins/libmacosx_plugin.dylib
  Reason: tried: '/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home/bin/./Sparkle.framework/Versions/A/Sparkle' (no such file), '/System/Library/Frameworks/Sparkle.framework/Versions/A/Sparkle' (no such file)

And libva errors are gone, so maybe it's just some VM issue(I'm running Ubuntu on Parallels). Video is still black though:

image

caprica commented 2 years ago

Honestly, I think the problem is in your local running environment.

Does the same version of VLC itself run and play videos correctly in that same environment?

It might be something wrong with the nightly build of VLC I presume you're using, in that it's somehow not compatible with your environment. Personally, I always build VLC myself from scratch, so I know I have all the dependencies available - but that is a tricky thing to do really.

caprica commented 2 years ago

I just tried this and I can reproduce the problem, and my VLC build is bang up to date.

I suspect therefore something is currently broken in the VLC 4.x code, or at least something has changed because I know for sure this used to work although I can not remember how long ago it was I last tried.

rafalniski commented 2 years ago

That's somehow...good thing then:) I tried to downgrade VLC with a couple of lower versions, but no luck.

caprica commented 2 years ago

We just have to wait until VLC 4.x becomes stable again, there's nothing to be fixed here in vlcj so I'll close the issue at least for now.

It definitely worked for me before, at least on Linux, but I can't remember how long ago I tried, maybe around 3-6 months or so, I don't recall.

caprica commented 2 years ago

There may be a change coming soon with VLC 4.x to address this, at least in the case I found.

In my case, the libva message is a red herring, there is actually an exception thrown pertaining to a native "get proc address" call being made outside of a GL context.

caprica commented 2 years ago

A merge request has been approved for the fix I mentioned, it will appear to the main git branch soon.

https://code.videolan.org/videolan/vlc/-/merge_requests/2028

caprica commented 2 years ago

I'm not 100% sure it's the same issue you reported originally, let's see...

rafalniski commented 2 years ago

Ok, cool, will try on my end when PR is merged.

caprica commented 2 years ago

That code was merged to VLC master now, I don't know if it's in today's nightly build or tomrrow's.

In any case, this now works for me again.

Note, I still get a libvlc warning in the console, but it does render video again.