JVLC status

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 23 Dec 2009 12:02

This: "-Djna.library.path=C:\Program Files\VideoLAN\VLC" doesn't work. It only works when the directory is added to the path-variable... :(

So, what is the exact line I need to add???
The way JNA works, I believe, on Windows is that it will first check jna.library.path for the dll, then the Windows path-variable as you have discovered.

Since I don't run Windows, I can't test this for you and this might be a load of rubbish, but maybe it's because that path has spaces in it.

Did you also try (note the alternative placement of the quote characters):

Code: Select all

-Djna.library.path="c:\program files\videolan\vlc"
Or:

Code: Select all

-Djna.library.path=c:\progra~1\videolan\vlc
Try in your Java application doing something like this:

Code: Select all

System.out.println(System.getProperty("jna.library.path"));
That might tell you if the property is being set to what you think it should be.
Edit: does anyone know what this piece of code does?

Code: Select all

Map options = new HashMap() { { put(Library.OPTION_DLOPEN_GLOBAL, Boolean.TRUE); } };
Since there is no OPTION_DLOPEN_GLOBAL in my Library... :(
If I remember correctly, someone, perhaps one of the JVLC developers, sent a patch to the JNA project asking to support this option. I don't know if the patch was ever accepted.

In the version of JNA originally used for JVLC, and the version of JNA available for my own bindings, this patch had not been applied to JNA so the library option is not available.

I don't have a link handy, but I'm pretty sure there's something on the JNA mailing lists about this, and why it was needed - it was not a recent post though.

I don't know if you still use my bindings, but I committed some debug code (just for you, even updated the jar file too!) to dump out where I think JNA is looking for the libvlc.dll - again, I can't test on Windows whether that debug is useful to you or not or even is correct, but it might be worth a try.

Or try kryptonite's suggestion of course.

All of the above obviously applies if you're using JVLC too, if you get this working, you can go back to JVLC if it suits you better.

curiousblue
New Cone
New Cone
Posts: 2
Joined: 23 Dec 2009 14:55

Re: JVLC status

Postby curiousblue » 23 Dec 2009 15:03

hi guys,
im not sure if this is an old topic or whatever, if it is i apologise but ive had similar problems over the last few days and thought id share my insight, and see if you guys can clarify.

Basically ive been trying to use the java libvlc bindings as a few people pointed out and following examples and even downloading a precompiled version i could not get it to work, as the jna module could not load libvlc.dll. i went over it with dependancy walker and noticed that although the libvlc dll is 32-bit, all my system dlls are 64-bit as im running 64-bit windows 7. ive just moved my project over to my other desktop running a 32bit windows XP and everything works peachily, so i believe that my problem lies in the fact that my java app is running in a 64 process it cannot load the 32bit dll.

i think my next course of action is gonna be to try and compile the libvlc and libvlccore dlls as i dont think they exist, but im a little out of my depth now so we'll see how it goes. if this is the problem for others ill keep posting my progress.


edit: okay recompiling the drivers was gonna be more effort than it was worth, i have however installed a 32-bit JDK and run the application in that and it seems to work although i get 'no access module matched "any"' errors. back to the drawing board...

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 23 Dec 2009 17:40

edit: okay recompiling the drivers was gonna be more effort than it was worth, i have however installed a 32-bit JDK and run the application in that and it seems to work although i get 'no access module matched "any"' errors. back to the drawing board...
Aren't those type of errors usually because of the plugin-path setting being missing?

curiousblue
New Cone
New Cone
Posts: 2
Joined: 23 Dec 2009 14:55

Re: JVLC status

Postby curiousblue » 23 Dec 2009 17:55

edit: okay recompiling the drivers was gonna be more effort than it was worth, i have however installed a 32-bit JDK and run the application in that and it seems to work although i get 'no access module matched "any"' errors. back to the drawing board...
Aren't those type of errors usually because of the plugin-path setting being missing?
yeah. as it turns out i had a relative path to the plugins directory in my code, replaced it with the full path and it all works now.

sherington i gotta say thanks for all your info, couldnt have got this far without it.

317070
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Feb 2009 23:50

Re: JVLC status

Postby 317070 » 23 Dec 2009 23:37

Did you also try (note the alternative placement of the quote characters):
There you go, I indeed tried them all (and many more :D). But now at least I knew it had nothing to do with that. I thought jna was a default java library, so one of the things I tried was to reinstall Java. IT IS NOT THE CASE. When I removed my JVLC library, it had some of the JNA files in it!!! Removing JVLC, getting the latest JNA AND EVERYTHING WORKS.

I LOVE YOU GUYS

And to show my gratitude, I will post a short but good tutorial with how to do things to set up a mediaplayer (extended from sheringtons(?) version) in a matter of weeks :D Consider it my goal for 2010...

ajmas
Big Cone-huna
Big Cone-huna
Posts: 935
Joined: 04 Feb 2006 07:33
VLC version: 3.0.x
Operating System: MacOS X
Location: Montreal, Canada

Re: JVLC status

Postby ajmas » 24 Dec 2009 17:46

I decided to put together an ant file to build the project, and to run the 'test player'.

Code: Select all

<?xml version="1.0"?> <project name="vlcj" basedir="." default="all"> <property name="debug" value="true"/> <property name="jdk.target" value="1.5"/> <property name="jdk.source" value="1.5"/> <property name="src.dir" value="src/main/java"/> <property name="rsrc.dir" value="src/main/resources"/> <property name="lib.dir" value="lib"/> <property name="class.dir" value="classes"/> <property name="dist.dir" value="dist/vlcj.jar"/> <property name="test-src.dir" value="src/test/java"/> <!-- ensure that this value is adjusted to point to the folder containg the libVLC dll/shared library, if you want to run the test player. On some platforms you may also need to define environment variables as well. Based on feedback: - MS-Windows: add the folder to the PATH system variable - MacOS X: add the folder to the LD_LIBRARY_PATH environment variable --> <property name="jna.library.path" value="DEFINE ME IN THE ANT FILE"/> <path id="libraries"> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> </path> <target name="compile"> <mkdir dir="${class.dir}"/> <javac srcdir="${src.dir}" destdir="${class.dir}" debug="${debug}" debuglevel="lines,vars,source" target="${jdk.target}" source="${jdk.source}"> <classpath refid="libraries"/> </javac> <copy todir="${class.dir}"> <fileset dir="${rsrc.dir}"/> </copy> </target> <target name="build.jar" depends="compile"> <jar destfile="${dist.jar}"> <fileset dir="webapp"> <exclude name="**/.svn"/> <exclude name="**/test/*"/> </fileset> </jar> </target> <target name="build.test" depends="compile"> <javac srcdir="${test-src.dir}" destdir="${class.dir}" debug="${debug}" debuglevel="lines,vars,source" target="${jdk.target}" source="${jdk.source}"> <classpath> <path refid="libraries"/> <path location="classes"/> </classpath> </javac> <copy todir="${class.dir}"> <fileset dir="${rsrc.dir}"/> </copy> </target> <target name="run.test" depends="build.test"> <echo message="Path to the folder containg the libVlc dll/shared lib: ${jna.library.path}"/> <java fork="true" classname="uk.co.caprica.vlcj.test.TestPlayer"> <classpath> <path refid="libraries"/> <path location="classes"/> </classpath> <jvmarg value="-Djna.library.path=lib/jna-3.0.4.jar"/> </java> </target> <target name="build.clean"> <delete dir="${class.dir}" /> </target> <target name="all" depends="build.clean,build.jar"/> </project>
Last edited by ajmas on 24 Dec 2009 18:17, edited 1 time in total.
Providing logs, messages, configuration info (VLC, OS, Hardware) and a clear explanation of the issue always helps the problem solvers help you, even if they don't end up solving the issue. Just think what you would need if you were solving someone else's problem. Additional: Always looking for eager and capable MacOS X developers to join the VLC team - for more information see here.

ajmas
Big Cone-huna
Big Cone-huna
Posts: 935
Joined: 04 Feb 2006 07:33
VLC version: 3.0.x
Operating System: MacOS X
Location: Montreal, Canada

Re: JVLC status

Postby ajmas » 24 Dec 2009 17:49

Having run the ant file that I submitted above I tried running it on MacOS X, and discovered a few issues:
- EnvironmentChecker class does not support .dylib, which is used by MacOS X, so for the time being I commented out the line calling it in TestPlayer class, in my installation.
- Having set jna.library.path to "/Applications/VLC.app/Contents/MacOS/lib/" I get the following error:

Code: Select all

run.test: [echo] Path to the folder containg the libVlc dll/shared lib: /Applications/VLC.app/Contents/MacOS/lib/ [java] Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc': dlopen(libvlc.dylib, 1): image not found [java] at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145) [java] at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188) [java] at com.sun.jna.Library$Handler.<init>(Library.java:123) [java] at com.sun.jna.Native.loadLibrary(Native.java:255) [java] at com.sun.jna.Native.loadLibrary(Native.java:241) [java] at uk.co.caprica.vlcj.binding.LibVlc.<clinit>(LibVlc.java:52) [java] at uk.co.caprica.vlcj.MediaPlayer.<init>(MediaPlayer.java:55) [java] at uk.co.caprica.vlcj.test.TestPlayer.main(TestPlayer.java:68) [java] Java Result: 1
Checking the VLC lib folder I get:

Code: Select all

$ ls /Applications/VLC.app/Contents/MacOS/lib/ libFLAC.8.dylib libdvbpsi.5.dylib libfribidi.0.dylib libkate.1.dylib libshout.3.dylib libtwolame.0.dylib libvorbis.0.dylib libSDL-1.3.0.dylib libdvdcss.2.dylib libgcrypt.11.dylib libmad.0.dylib libspeex.1.dylib libupnp.3.dylib libvorbisenc.2.dylib libSDL_image.0.dylib libdvdnav.4.dylib libgnutls.26.dylib libmpcdec.5.dylib libtag.1.dylib libvlc.2.dylib libxml2.2.dylib libass.4.dylib libdvdread.4.dylib libintl.8.dylib libmpeg2.0.dylib libtheora.0.dylib libvlc.dylib libzvbi.0.dylib libcaca.0.dylib libfontconfig.1.dylib libixml.2.dylib libogg.0.dylib libthreadutil.2.dylib libvlccore.2.dylib libdca.0.dylib libfreetype.6.dylib libjpeg.7.dylib libpng12.0.dylib libtiff.3.dylib libvlccore.dylib
Any ideas?
Providing logs, messages, configuration info (VLC, OS, Hardware) and a clear explanation of the issue always helps the problem solvers help you, even if they don't end up solving the issue. Just think what you would need if you were solving someone else's problem. Additional: Always looking for eager and capable MacOS X developers to join the VLC team - for more information see here.

ajmas
Big Cone-huna
Big Cone-huna
Posts: 935
Joined: 04 Feb 2006 07:33
VLC version: 3.0.x
Operating System: MacOS X
Location: Montreal, Canada

Re: JVLC status

Postby ajmas » 24 Dec 2009 18:13

After a bit of research and experimenting, it turns out for MacOS X there are three issues that need to be addressed:

- If using JDK 1.6, then you have to use the 64-bit version of libVLC, which I have now downloaded

- There is an issue with two symbolic links in the VLC.app/Contents/MacOS/lib folder:

Code: Select all

-rw-r--r-- 1 ajmas admin 105288 30 Oct 10:30 libvlc.2.dylib lrwxr-xr-x 1 ajmas admin 51 30 Oct 10:30 libvlc.dylib -> ./VLC-release.app/Contents/MacOS/lib/libvlc.2.dylib -rw-r--r-- 1 ajmas admin 826580 30 Oct 10:30 libvlccore.2.dylib lrwxr-xr-x 1 ajmas admin 55 30 Oct 10:30 libvlccore.dylib -> ./VLC-release.app/Contents/MacOS/lib/libvlccore.2.dylib
They should both be modified to point to: ./libvlc.2dylib and ./libvlccore.2.dylib, respectively.

- Setting jna.library.path does not seem to work. Instead LD_LIBRARY_PATH needs to be set, so:

Code: Select all

export LD_LIBRARY_PATH=/Applications/VLC.app/Contents/MacOS/lib/
Providing logs, messages, configuration info (VLC, OS, Hardware) and a clear explanation of the issue always helps the problem solvers help you, even if they don't end up solving the issue. Just think what you would need if you were solving someone else's problem. Additional: Always looking for eager and capable MacOS X developers to join the VLC team - for more information see here.

317070
Blank Cone
Blank Cone
Posts: 10
Joined: 21 Feb 2009 23:50

Re: JVLC status

Postby 317070 » 29 Dec 2009 23:53

Does someone know which of the plugins-libraries JVLC actually uses? I now provide them with my program, but they take almost 25Mb... :?

ajmas
Big Cone-huna
Big Cone-huna
Posts: 935
Joined: 04 Feb 2006 07:33
VLC version: 3.0.x
Operating System: MacOS X
Location: Montreal, Canada

Re: JVLC status

Postby ajmas » 06 Jan 2010 16:58

I have added stub for this project in the wiki: http://wiki.videolan.org/Jvlc
Providing logs, messages, configuration info (VLC, OS, Hardware) and a clear explanation of the issue always helps the problem solvers help you, even if they don't end up solving the issue. Just think what you would need if you were solving someone else's problem. Additional: Always looking for eager and capable MacOS X developers to join the VLC team - for more information see here.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 06 Jan 2010 19:45

Hi,
I have added stub for this project in the wiki: http://wiki.videolan.org/Jvlc
You created a "JVLC" page in the WIKI but it links to the different "VLCJ" project (there's only so many acronyms to choose from!). VLCJ is a completely independent effort and I just want to say that I wouldn't want anyone to get the wrong idea about it such as mistaking VLCJ for the "official" JVLC (which as far as I know is still alive) or thinking that the vlc developers are responsible for it or hassling them for support for it.

ajmas
Big Cone-huna
Big Cone-huna
Posts: 935
Joined: 04 Feb 2006 07:33
VLC version: 3.0.x
Operating System: MacOS X
Location: Montreal, Canada

Re: JVLC status

Postby ajmas » 15 Jan 2010 19:29

Beyond VLCJ, which seems to have some active development, I have no current information on the status of VLCJ. I have updated the Wiki as appropriate. If anyone has any information they can provide to the wiki pages, then please update them as appropriate.
Providing logs, messages, configuration info (VLC, OS, Hardware) and a clear explanation of the issue always helps the problem solvers help you, even if they don't end up solving the issue. Just think what you would need if you were solving someone else's problem. Additional: Always looking for eager and capable MacOS X developers to join the VLC team - for more information see here.

whome
Blank Cone
Blank Cone
Posts: 37
Joined: 14 Jun 2008 15:40

Re: JVLC status

Postby whome » 07 Feb 2010 17:35

[WinXP, VLC1.0.5, Java1.6 ]
Nice, i run a test media player (http://code.google.com/p/vlcj/) and worked fine.

May I suggest few updates to the build.xml and MANIFEST.MF handling. See example codes below.
* compile app sources and test sources, this will catch syntax errors on test classes immediately
* compile Java 1.6 libraries, desktop users should use it by now
* jar vlcj-SNAPSHOT.jar as previously, do not insert test classes
* jar vlcj-SNAPSHOT-test.jar to include test classes
* added "all-build" target to make a basic compilation without srczip and javadocs
* added manifest handling, its always good to have a proper information within a .jar files (url, version, build num and date)
* added MANIFEST.MF file to source path
* TestPlayerB.java example using a getVLCFolders() helper method to read vlc plugin folder
* example TestPlayerB.bat script, I am sure linux users can figure it out how to make .sh script

build.xml

Code: Select all

<project name="vlcj" default="all"> <property name="project.version" value="SNAPSHOT"/> <property name="version" value="1.0"/> <path id="project.classes"> <pathelement location="lib/jna-3.0.9.jar"/> </path> <tstamp> <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" /> </tstamp> <target name="prepare"> <mkdir dir="build"/> </target> <target name="compile" depends="prepare"> <mkdir dir="build/classes"/> <javac srcdir="src/main/java:src/main/resources:src/test/java:src/test/resources" destdir="build/classes" classpathref="project.classes" target="1.6" source="1.6" debug="on"/> </target> <target name="updatemanifest" description="Update manifest"> <buildnumber file="build.num"/> <copy file="src/main/java/META-INF/MANIFEST.MF" todir="build/classes/META-INF/" overwrite="true" preservelastmodified="true" /> <manifest file="build/classes/META-INF/MANIFEST.MF" mode="update"> <attribute name="Implementation-Version" value="${version}.${build.number} (${TODAY})"/> </manifest> </target> <target name="jar" depends="compile, updatemanifest"> <jar jarfile="build/${ant.project.name}-${project.version}.jar" manifest="build/classes/META-INF/MANIFEST.MF" > <fileset dir="build/classes" excludes="uk/co/caprica/vlcj/test/**" /> <fileset dir="doc" includes="gpl.txt,README.LICENSE,README"/> </jar> <jar jarfile="build/${ant.project.name}-${project.version}-test.jar" manifest="build/classes/META-INF/MANIFEST.MF" > <fileset dir="build/classes" includes="uk/co/caprica/vlcj/test/**" /> </jar> </target> <target name="srcjar" depends="prepare"> <jar jarfile="build/${ant.project.name}-${project.version}-sources.jar" basedir="src/main/java"/> </target> <target name="javadoc" depends="prepare"> <javadoc sourcepath="src/main/java" destdir="build/javadoc" classpathref="project.classes" access="protected" author="yes" windowtitle="VLCJ Documentation" footer="(C)2010 Caprica Software Limited"/> </target> <target name="docjar" depends="javadoc"> <jar jarfile="build/${ant.project.name}-${project.version}-javadoc.jar" basedir="build/javadoc"/> </target> <target name="clean"> <delete dir="build"/> </target> <target name="dist" depends="jar, srcjar, docjar"> <copy todir="dist"> <fileset dir="build" includes="*.jar"/> <fileset dir="doc" includes="gpl.txt,README.LICENSE,README"/> </copy> </target> <target name="all_build" depends="clean, jar" description="Perform a full clean build"/> <target name="all" depends="clean, dist" description="Perform a full clean build and produce distribution jar files"/> </project>
src/main/java/META-INF/MANIFEST.MF

Code: Select all

Implementation-Title: vlcj Implementation-Version: 1.0.0 (2009-01-31 18:30:45) Implementation-Vendor: vlcj Implementation-URL: http://code.google.com/p/vlcj/

src/test/java/uk/co/caprica/vlcj/test/TestPlayerB.java

Code: Select all

package uk.co.caprica.vlcj.test; import java.io.File; import java.awt.BorderLayout; import java.awt.Canvas; import java.awt.Color; import java.awt.event.*; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.KeyStroke; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.InputMap; import uk.co.caprica.vlcj.MediaPlayer; import uk.co.caprica.vlcj.MediaPlayerEventListener; import uk.co.caprica.vlcj.VideoMetaData; import uk.co.caprica.vlcj.check.EnvironmentChecker; import com.sun.jna.Platform; /** * TestPlayerB -Djna.library.path="c:/program files/videolan/vlc;c:/some/other/lib" <path_to_video_file> */ public class TestPlayerB { /** * Parse VLC and plugin folders from jna.library.path value */ private static String[] getVLCFolders() { String PATH_SEP = System.getProperty("path.separator"); // win=";", linux=":" String FILE_SEP = System.getProperty("file.separator"); // win="\", linux="/" String LIB_FILE = (Platform.isWindows() ? "libvlc.dll" : "libvlc.so"); File vlcFolder = null; String[] paths = System.getProperty("jna.library.path").split(PATH_SEP); for(String path : paths) { File folder = new File(path); File file = new File(folder, LIB_FILE); if (file.exists()) { vlcFolder = folder; break; } } String path, plugin; if (vlcFolder != null) { path = vlcFolder.getAbsolutePath(); plugin = new File(vlcFolder, "plugins/").getAbsolutePath(); } else { path = plugin = null; // VLC not found } // return [0]=vlc folder, [1]=plugin folder return new String[] { path, plugin }; } public static void main(String[] args) throws Exception { String filename = args[0]; final String[] VLC_DIRS = getVLCFolders(); System.out.println("VLC: " + VLC_DIRS[0]); System.out.println("plugins: " + VLC_DIRS[1]); // http://wiki.videolan.org/VLC_command-line_help String[] VLC_ARGS = new String[] { "--plugin-path=" + VLC_DIRS[1], "-v", // verbose "--no-video-title-show", "--no-media-library", "--no-stats", "--intf=dummy", "--no-video-deco", //blend, linear, yadif, x "--vout-filter=deinterlace", "--deinterlace-mode=yadif", //"--fullscreen", //"--overlay", "--aspect-ratio=5:4", "" }; Canvas videoSurface = new Canvas(); videoSurface.setBackground(Color.black); MediaPlayer mediaPlayer = new MediaPlayer(VLC_ARGS); final JFrame f = new JFrame("VLCJ Test Player"); f.setLayout(new BorderLayout()); f.setBackground(Color.black); f.add(videoSurface, BorderLayout.CENTER); f.setBounds(100, 100, 720, 576); f.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { System.exit(0); } }); Action exitAction = new AbstractAction() { @Override public void actionPerformed(java.awt.event.ActionEvent ae) { System.exit(0); } }; Action keyAction = new AbstractAction() { @Override public void actionPerformed(java.awt.event.ActionEvent ae) { System.out.println( String.format("id: %d, cmd: %s, source: %s", ae.getID(), ae.getActionCommand(), ae.getSource()) ); if (ae.getActionCommand().equalsIgnoreCase("S")) { //todo... } } }; JPanel content = (JPanel)f.getContentPane(); content.getActionMap().put("exitAction", exitAction); content.getActionMap().put("keyAction", keyAction); InputMap inputMap = content.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put( KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true), "exitAction" ); // "released ESCAPE" inputMap.put( KeyStroke.getKeyStroke(KeyEvent.VK_P, 0, true), "keyAction" ); // "released P" inputMap.put( KeyStroke.getKeyStroke(KeyEvent.VK_S, 0, true), "keyAction" ); // "released S" inputMap.put( KeyStroke.getKeyStroke(KeyEvent.VK_D, 0, true), "keyAction" ); // "released D" f.setVisible(true); mediaPlayer.addMediaPlayerEventListener(new MediaPlayerEventListener() { public void finished(MediaPlayer mediaPlayer) { System.out.println("Finished"); System.exit(0); } public void paused(MediaPlayer mediaPlayer) { System.out.println("Paused"); } public void playing(MediaPlayer mediaPlayer) { System.out.println("Playing"); } public void stopped(MediaPlayer mediaPlayer) { System.out.println("Stopped"); } @Override public void metaDataAvailable(MediaPlayer mediaPlayer, VideoMetaData videoMetaData) { System.out.println("Meta Data Available"); System.out.println(videoMetaData); //f.setSize(videoMetaData.getVideoDimension()); } }); mediaPlayer.setVideoSurface(videoSurface); mediaPlayer.playMedia(filename); Thread.currentThread().join(); } }
TestPlayerB.bat

Code: Select all

set vlc=c:/program files/videolan/vlc set file=C:/testfiles/video1.mp4 set cp=./build/vlcj-SNAPSHOT.jar;./build/vlcj-SNAPSHOT-test.jar;./lib/jna-3.0.9.jar java -version java -Djna.library.path="%vlc%;./lib" -classpath %cp% uk.co.caprica.vlcj.test.TestPlayerB "%file%" pause

chcassan
New Cone
New Cone
Posts: 2
Joined: 10 Feb 2010 16:13

Re: JVLC status

Postby chcassan » 10 Feb 2010 16:27

Hi, I'm new here..

..i'm trying to develop a simple media player integrated in an applet. I don't want to use JMF because is pretty old and unmantained and i can't use a java application.

The applet should show rtp streams coming from a server.

..so jVlc seems to be a good road to follow. Actually i've changed the sample player extending VlcClient to be an Applet. I've overloaded the init method and i've created all jars and signed them with a valid certificate (self-signed). When i try to connect to the containing web page the applet isn't able to start.

It says that VlcClient doesn't extend java.applet.Applet (this happens both extending Applet and JApplet) any idea? of course in the java applet launcher under eclipse everything works perfectly.

Any Idea?

dhirwinjr
Blank Cone
Blank Cone
Posts: 35
Joined: 14 Jan 2008 17:46
Operating System: Windows / Linux

Re: JVLC status

Postby dhirwinjr » 31 Mar 2010 06:37

Wow, this is really great work. I looked at JVLC about two years ago and at the time decided it wasn't worth the effort to get it to work as I needed. So instead I created a wrapper that controlled VLC using the telnet and RC interfaces. Works pretty well but it'd be a lot slicker to be able to embed the actual video within a Java client application.

Using this forum/thread I've been able to play a single video file within a Java client application which is great. But what about playing more than one media at a time? In my current VLC implementation (using telnet & RC) I create a 2x2 mosaic that allows me to view either a single stream or four simultaneous streams (in this case I'm using VLC to decode live streaming video). At a minimum I'd like to be able to create a 2x2, but ultimately I'd really love to be able to create any layout on the fly (1x1, 2x2, maybe a 3x2, etc.). Would I need to create a mosaic (just programatically via Java) or is there a different approach?

Any ideas and/or comments are appreciated.

Thanks,
Dave

kryptonite
Blank Cone
Blank Cone
Posts: 52
Joined: 22 May 2009 12:01

Re: JVLC status

Postby kryptonite » 31 Mar 2010 12:49

I play upto 16 streams in my app.
I use a single libvlc instance and each stream has it's own canvas, mediaPlayer, mediaDescriptor, etc instances.
Finally all canvases are added to a JPanel and I customize the size and layout as per my requirement.

dhirwinjr
Blank Cone
Blank Cone
Posts: 35
Joined: 14 Jan 2008 17:46
Operating System: Windows / Linux

Re: JVLC status

Postby dhirwinjr » 01 Apr 2010 01:20

Cool...that's what I was hoping to hear. Having only looked at this briefly I thought maybe you could only create a single instance of the mediaPlayer and a single canvas but if you can have multiple instances that makes things a lot easier than having to do any type of mosaic. I will definitely be jumping into this a bit more as this looks like it could really help a lot.

Thanks again to everyone who has helped with.

Dave

dhirwinjr
Blank Cone
Blank Cone
Posts: 35
Joined: 14 Jan 2008 17:46
Operating System: Windows / Linux

Re: JVLC status

Postby dhirwinjr » 12 Apr 2010 20:30

I've been playing around with VLCJ for a little bit and it's very cool. This question may be more appropriate in a separate discussion but how about older versions of VLC like 0.8.6d? RTSP seems to be broken in VLC (may be actually in the Live555 implementation) but video now locks up after ~10 seconds. I tried using VLCJ on 0.8.6d but the APIs have probably changed and I got an "java.lang.UnsatisfiedLinkError: Error looking up function 'libvlc_media_player_new': The specified procedure could not be found." exception. Anyone built VLCJ to anything earlier than 1.0.0? Or at the very least where I can find the interface for 0.8.6d?

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 13 Apr 2010 21:59

When I first created vlcj it was before 1.0.0 of libvlc was released, so at one point in time it did work with earlier versions. But that doesn't really help you because that code may not even exist anymore, my memory is a bit hazy.

What I tried to do was not just dump some code out there, but to provide enough information (e.g. in earlier pages in this forum) so you could roll your own solution if you need to (it's really not that hard).

I would probably suggest that you get the tagged source code of vlc for the version that you want to work with and compare what's in the libvlc header file with what's in the Java bindings. Once you've done that you'll see how much rework you'd have to do on the example media player implementation provided by vlcj.

I really don't have the bandwidth to maintain old versions, although I do intend to try and find some time to make sure it still works with the latest version of libvlc.

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: JVLC status

Postby Rémi Denis-Courmont » 13 Apr 2010 22:10

libvlc 0.8.6 is quite a restricted subset of libvlc 0.9.0, and is not fully binary compatible. And I don't need to mention that VLC 0.8.6 is buggy as hell.

Please don't waste your time writing API bindings for this. In my opinion, people should be updating their bindings to libvlc 1.1 already instead.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

adanecito
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 06 Mar 2007 17:59

Re: JVLC status

Postby adanecito » 22 Apr 2010 16:11

I agree. I tried vlcj and although better in some respects than the jvlc but it carshes with the newer 1.1 or 1.2. I have heard of others getting 1.1 and jvlc to work but not sure how much effort was involved to port jvlc to 1.1.
I will take sharington's advice and look at the libvlc.h file.

Regards,
-Tony

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 22 Apr 2010 18:11

Correct me if I'm wrong, but vlc 1.1 isn't officially released yet is it, let alone 1.2? There's a 1.1.0-pre1 tag there and that looks like the latest to me.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 22 Apr 2010 20:18

To anyone who may be interested,

I have confirmed my bindings work with 1.0.5 of libvlc and I've updated the vlcj googlecode project accordingly. I've created (finally) a 1.0.0 release and tagged it as compatible with libvlc 1.0.5. This is in advance of changes to make it all work with 1.1 when that becomes available.

See http://code.google.com/p/vlcj/downloads/list

I did try to check my bindings against later versions, but...

I can not build vlc 1.0.6 from the source bundle due to compilation/build errors in x264.c.

I can not build vlc 1.1.0-pre1 from git due to either unresolved dependencies or compiler/build errors. I don't have the stomach for struggling to get 1.1.0 from git to compile right now. Life is too short.

I will wait for a 1.1.0 source bundle and then check and update my bindings.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC status

Postby sherington » 24 Apr 2010 10:18

I was able to get a working build of 1.1 from here, http://www.webupd8.org/2010/02/vlc-110- ... n-web.html, so I've made some progress.

There are quite a lot of quite significant changes between libvlc 1.0.x and libvlc 1.1.x.

I have updated my bindings for libvlc 1.1.x and it works for me. It is not a drop-in replacement. If you do go ahead and download it, please make sure to read all the README's and expect that you may have to change your client code.

The most significant change to me is the setting of the video surface - there are now different functions in libvlc to use depending on whether you are using x11, win32 etc.

http://code.google.com/p/vlcj/

There's a test video player in there too, and it works just fine on Linux, but will need some more work to be able to use it on Windows or Mac platforms.

Any feedback is always appreciated.

BraCa
New Cone
New Cone
Posts: 7
Joined: 24 Apr 2010 16:07

Re: JVLC status

Postby BraCa » 24 Apr 2010 16:15

I was able to get a working build of 1.1 from here, http://www.webupd8.org/2010/02/vlc-110- ... n-web.html, so I've made some progress.

There are quite a lot of quite significant changes between libvlc 1.0.x and libvlc 1.1.x.

I have updated my bindings for libvlc 1.1.x and it works for me. It is not a drop-in replacement. If you do go ahead and download it, please make sure to read all the README's and expect that you may have to change your client code.

The most significant change to me is the setting of the video surface - there are now different functions in libvlc to use depending on whether you are using x11, win32 etc.

http://code.google.com/p/vlcj/

There's a test video player in there too, and it works just fine on Linux, but will need some more work to be able to use it on Windows or Mac platforms.

Any feedback is always appreciated.
Well, i've found a way to make it work in windows (http://code.google.com/p/vlcj/issues/detail?id=1) but atm, i cant make fullscreen mode to work, if anyone here knows how can i do it i appreciate

thanks


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests