JVLC on MacOS X + Java 6

macOS specific usage questions
vvessan
New Cone
New Cone
Posts: 1
Joined: 28 Nov 2008 15:21

JVLC on MacOS X + Java 6

Postby vvessan » 28 Nov 2008 15:28

Hello,
have anybody successfully used JVLC on MacOS X with Java 6 (64bit)? I have tries multiple versions of VLC (intel only, universal binary, 0.9.x, 1.0) without success. I'm getting this exception:

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': dlopen(/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib, 1): no suitable image found. Did find: /Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib: no matching architecture in universal wrapper at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157) at com.sun.jna.Library$Handler.<init>(Library.java:123) at com.sun.jna.Native.loadLibrary(Native.java:260) at com.sun.jna.Native.loadLibrary(Native.java:246) at org.videolan.jvlc.internal.LibVlc.<clinit>(LibVlc.java:41) at org.videolan.jvlc.JVLC.<init>(JVLC.java:45)
Any advice welcome. Thank you.

doti.is
New Cone
New Cone
Posts: 1
Joined: 06 Dec 2008 01:45

Re: JVLC on MacOS X + Java 6

Postby doti.is » 06 Dec 2008 01:50

I've a similar error. Seems like jna search that lib in /usr/share/lib which, in my opinion, is an error. If you copy the libs from ~/Applications/VLC/Contents/MacOS/lib your app will try to start (with errors).

Has someone a solution for this?

With the copied libs the new error is:
[00000001] main libvlc debug: VLC media player - version 0.9.6 Grishenko - (c) 1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure '--enable-release' '--enable-update-check' '--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk' 'PKG_CONFIG_PATH=:/opt/local/lib/pkgconfig'
[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc error: no memcpy module matched "any"
[00000354] main access error: no access module matched "file"
[00000353] main input error: open of `file/xspf-open:///Users/doti/Library/Preferences/VLC/ml.xspf' failed: could not create access: no access module matched "file"
[00000357] main interface error: no interface module matched "hotkeys,none"
[00000357] main interface error: no suitable interface module
[00000001] main libvlc error: interface "hotkeys,none" initialization failed

glebfrank
Blank Cone
Blank Cone
Posts: 10
Joined: 09 Dec 2008 08:39

Re: JVLC on MacOS X + Java 6

Postby glebfrank » 09 Dec 2008 08:43

The vlc libraries are 32-bit, at least those I have. Does JVLC work with Java 5 for you (on the Mac) ?

bcatarino
New Cone
New Cone
Posts: 3
Joined: 13 Jan 2010 10:24

Re: JVLC on MacOS X + Java 6

Postby bcatarino » 13 Jan 2010 10:35

Hi there.

The "no access module" error you get is probably due to the lack of plugins when you run jvlc.

When you initialize the JVLC instance, you should use the constructor with String[] as parameter and include the parameter "plugins-path".

I have something like this:

Code: Select all

... JVLC jvlc = new JVLC(getDefaultMediaParameters()); ...
and

Code: Select all

public String[] getDefaultMediaParameters() { File pluginsDir = new File(System.getProperty("user.home"), System.getProperty("vlc.plugins.destdir")); int i = 0; String[] arg = new String[4]; arg[i++] = "--intf=dummy"; arg[i++] = "--ignore-config"; arg[i++] = "--no-plugins-cache"; arg[i++] = "--plugin-path=" + pluginsDir.getAbsolutePath(); return arg; }
I'm experiencing some problems in mac too. I'll test your solution by copying the lib files to /usr/share/lib, with the JVLC parameters I0m posting. I'll give feedback about the result of the test (hopefully, it will be successfull).

Best Regards...

cicciozire
New Cone
New Cone
Posts: 1
Joined: 15 Jan 2010 21:27

Re: JVLC on MacOS X + Java 6

Postby cicciozire » 15 Jan 2010 21:31

Hi,

i have some problems with my First Application with Jvlc: i try to realize a simple player.
My Development Environmet is:

MAC OS X 10.6
Netbeans 6.7.1
JDK 5
jna3.0.9
jvlc-core-1.0.0-SNAPSHOT
vlc-1.0.3

I have the follow error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': dlopen(libvlc.dylib, 1): image not found

Do you have some ideas how i can solve my problem?

Thanks
Francesco

bcatarino
New Cone
New Cone
Posts: 3
Joined: 13 Jan 2010 10:24

Re: JVLC on MacOS X + Java 6

Postby bcatarino » 17 Jan 2010 14:05

Hi.

Same as me. Apparently JNA can't find the needed libraries, even if it is possible to load them sucessfully with System.loadLibrary. I would say there is one environment variable or property that is not set or is set to an incorrect location. Maybe there is a need to set something more than the path to jnidispatch lib to jna.library.path.

I'm also starting to question myself if the libjnidispatch.jnilib in the jna.jar file (darwin folder) is correct to use with mac? And this should work for jna with every single version of mac OS?

I'll try to test some scenarios related to both questions and post back if I have any results.

Please, if someone gets there before, just post here so we all get to know how to make jvlc work in mac.

Thanks and best regards

bcatarino
New Cone
New Cone
Posts: 3
Joined: 13 Jan 2010 10:24

Re: JVLC on MacOS X + Java 6

Postby bcatarino » 17 Jan 2010 17:36

Hi, finally got JNA to load libvlc.dylib.

Apparently, I was working with an universal 1.0.X version of vlc. I downloaded the 0.9.10 ppc specific binaries (the arch of my test machine) and pointed jna.library.path to the "lib" folder of this new ppc build. Same for the plugins. The library loading works great. I'm having another problem thou.

With this code:

Code: Select all

... int i = 0; String[] params = new String[4]; params[i++] = "--intf=dummy"; params[i++] = "--ignore-config"; params[i++] = "--no-plugins-cache"; params[i++] = "--plugin-path=/Users/linkare/Desktop/testeJVLC/libsvlc/ppc/modules"; JVLC jvlc = new JVLC(params); MediaDescriptor md = new MediaDescriptor(jvlc, "/Users/linkare/Desktop/testeJVLC/video.mp4"); MediaPlayer mp = new MediaPlayer(md); mp.play(); ...
I get the following error:
[00000001] main libvlc debug: VLC media player - version 0.9.10 Grishenko - (c) 1996-2009 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ../configure '--enable-release' '--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk'
[00000001] main libvlc debug: translation test: code is "C"
[00000362] macosx opengl error: no MacOS X interface present
2010-01-17 16:16:27.961 java[664:10b] *** _NSAutoreleaseNoPool(): Object 0x1e00b0 of class NSException autoreleased with no pool in place - just leaking
Stack: (0x92ccddac 0x92bfae14 0x92c018c8 0x9122b0d4 0x569c 0x27bc)
2010-01-17 16:16:27.976 java[664:10b] *** _NSAutoreleaseNoPool(): Object 0x1baee0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x92ccddac 0x92bfae14 0x92c04d08 0x91298dc4 0x92ec34ec 0x9122bb50 0x569c 0x27bc)
2010-01-17 16:16:27.978 java[664:10b] *** _NSAutoreleaseNoPool(): Object 0x17fbe0 of class NSCFData autoreleased with no pool in place - just leaking
Stack: (0x92ccddac 0x92bfae14 0x92c0c884 0x92c0c730 0x91298e18 0x92ec34ec 0x9122bb50 0x569c 0x27bc)
2010-01-17 16:16:27.979 java[664:10b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1002) creating CGSWindow'
2010-01-17 16:16:27.981 java[664:10b] Stack: (
2435419376,
2464953580,
2435419136,
2435419192,
2505453724,
2506548816,
2505804680,
2504955668,
2504953412,
2504952320,
143615940,
143619528,
2462062312,
2434969812,
22172,
10172
)
Apparetly, i'm not able to create a native window that JVLC can use the display the video. I get a "macosx opengl error: no MacOS X interface present". Am i'm missing any required library?

If I create my video output window myself (with a Canvas), I can load the first frame into the canvas, but the video doesn't play. I have no sound or video playing, just a still image (sometimes I only get a black canvas). Here's my code:

Code: Select all

int i = 0; String[] params = new String[4]; params[i++] = "--intf=dummy"; params[i++] = "--ignore-config"; params[i++] = "--no-plugins-cache"; params[i++] = "--plugin-path=/Users/linkare/Desktop/testeJVLC/libsvlc/ppc/modules"; Canvas c = new Canvas(); c.setSize(320, 240); c.setBackground(Color.BLACK); JFrame frame = new JFrame(); frame.add(c); frame.setBackground(Color.DARK_GRAY); frame.setSize(480, 360); frame.setVisible(true); JVLC jvlc = new JVLC(params); jvlc.setVideoOutput(c); MediaDescriptor md = new MediaDescriptor(jvlc, "/Users/linkare/Desktop/testeJVLC/video.mp4"); MediaPlayer mp = new MediaPlayer(md); mp.play();
I get the following output:
[00000001] main libvlc debug: VLC media player - version 0.9.10 Grishenko - (c) 1996-2009 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ../configure '--enable-release' '--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk'
[00000001] main libvlc debug: translation test: code is "C"
*** LibVLC Exception not handled: (null)
Set a breakpoint in 'libvlc_exception_not_handled' to debug.

I might have to pass more (or maybe less) than the four parameters in the String array when I initialize the JVLC object to be able to display the video on mac, but i don't know which ones. Does anyone have any idea how to solve this?

Thank you.

geostein8888
Cone that earned his stripes
Cone that earned his stripes
Posts: 142
Joined: 15 Dec 2010 11:32

Re: JVLC on MacOS X + Java 6

Postby geostein8888 » 20 Feb 2011 08:20

Hello,
right now i'm trying to bring the VLCJ library under MacOs to work and i have a similar problem you described here, i hear the adio but the video is not connected to the Canvas Screen, only when i give a null insetad of the adress of the Canvas to the native library i can see the video as overlay in th emiddle of the max screen (it is not connected to my application). did you fixed this problem with the JVLC Library? or do you have some considerations for me here?

Georg

Srinandha
New Cone
New Cone
Posts: 1
Joined: 28 Feb 2011 05:00

Re: JVLC on MacOS X + Java 6

Postby Srinandha » 28 Feb 2011 05:05

Hi,
I am also facing the same problem. If u solve plz post it.

geostein8888
Cone that earned his stripes
Cone that earned his stripes
Posts: 142
Joined: 15 Dec 2010 11:32

Re: JVLC on MacOS X + Java 6

Postby geostein8888 » 28 Feb 2011 08:35

Hello,
i still have no solution for this. Right now my problem is i have to make samoe debug outputs into the vlc source but i'm not able to compile it. Do you have a workung xcode project for the vlc player, then io can debug this thing. i have now an apple since 2 weeks and ecerything is too new for me

Georg


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests