JVLC status

This forum is about all development around libVLC.
adanecito
Cone that earned his stripes
Cone that earned his stripes
Posts: 151
Joined: 06 Mar 2007 17:59

Re: JVLC status

Postby adanecito » 26 Apr 2010 22:26

Hi,

Where are the READMES? What did you change in vlcj to make it work?

Thanks,
-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 » 27 Apr 2010 17:29

Hi,

Where are the READMES? What did you change in vlcj to make it work?

Thanks,
-Tony
BraCa's post contains a link to the issue that describes the required change to make it work on Windows.

I integrated that change in vlcj so it works out of the box now on Windows if you would like to download the latest version.

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

Re: JVLC status

Postby adanecito » 27 Apr 2010 20:20

Hi Sherington,

First off many thanks for updating vlcj. I did update and had a major issue but found a work around. The issue you may not have spotted but for me it had to do with viewing an http url. The parse method in the MediaPlayer.java when called by setMedia causes the MediaPlayer to lockup. What I did was coded around that for now so it only gets called when the media string has a file: in it. If you have a different recommendation I am willing to try it.

Otherwise so far it works great for windows except for the fullscreen call does not seem to work as mentioned earlier.

Also for some reason when running vlcj under Linux it crashes my app when using the url with http in it. I still need to try a file type url to see if that works. So I need to know more about the vlc libraries you used and how they are structured for your test you did. I have Ubuntu 9.1 and used that for my test. I really want vlcj and Linux to work for me.

Again many thanks!
-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 » 27 Apr 2010 21:34

Hi,

I updated the release again today to fix some packaging issues and some issues for Windows users.

With regard to the problems you mentioned, I must admit I mainly play videos from local files (or network shares) for testing. I will try and find some time to look at making sure it works with http, streaming and full-screen mode.

I will also put a fix in for the issue you raised. I'm not sure how useful the parsing is to be honest so I might just take it out completely.

I've never seen true full-screen mode working properly on Windows, but I know for sure I've had these bindings working properly under full-screen exclusive mode on Linux (Ubuntu Karmic) before.

Thanks for the feedback.

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

Re: JVLC status

Postby adanecito » 27 Apr 2010 23:13

Hi Sherington,

Thanks for the feedback. I agree about the parser unless internally vlc needs some structure populated I would remove it.

Also, I know the fullscreen was working with 1.0.6 and vlcj but I seem to remember fullscreen not working in 1.1. Does it work for lunux with vlc 1.1.0pre3?

Also, I had a strange occurance for http where the lua module caused crashes for 1.1 wunder windows and that is the first time I had seen that happen. I have not gone back and reinserted the lua module to see with the updated bindings if I get a crashing to occur. If the file viewing works for me for linux then I will remove the linux lua so from my distribution and try http streaming test again.

What are the updates for windows users you hinted at?

If I run into more issues I will let you know.

Thanks again,
-Tony

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

Re: JVLC status

Postby adanecito » 28 Apr 2010 14:11

vlcj & Linux testing,

Well I setup eclipse on ubuntu 9.1 and started troubelshooting.

Found the following:
1. --dummy-quiet & --no-high-priority crash vlc under linux
2. When running in my program using http file I get vlc crashing in libmemcpy3dn_plugin.so
3. When running TestPlayer.java and running a video file I get vlc crash libvlc.so something about a libvlc_media_add_option_flag.

I am using vlc 1.1.0-git compiler gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)

Regards,
-Tony

MarcoM
New Cone
New Cone
Posts: 4
Joined: 28 Apr 2010 14:42

Re: JVLC status

Postby MarcoM » 28 Apr 2010 15:33

my scenario:
VLC 1.1.pre2
VLCJ 1.1b
WindowsXP

run from eclipse TestPlayer with no problem
(I've setted the correct "jna.library.path")
with this I've also made a test with UDP,
I've passed a udp url.. udp://234.0.0.1:1234 to MediaPlayer.playMedia
udp is not implemented ? or I'm wrong something ?
in general for connect to stream I must use same method for local file .. mediaPlayer.playMedia ?

I've also try to use VLCJ 1.1c
TestPalyer run with no problem

tnx for your work sherington :wink:

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

Re: JVLC status

Postby adanecito » 28 Apr 2010 16:28

Hi Sheriton,

The last tests I ran were under Linux not windows. Windows works fine except for the fullscreen function.

On linux I found out that the 2 options I listed were for windows only.

I will run some more tests tonight. The vlc dev team is looking into the memcpy module issue.

Regards,
-Tony

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

Re: JVLC status

Postby adanecito » 28 Apr 2010 16:30

Sorry I have not tried udp protocol before so I do not know if it is expected to work.

Regards,
-Tony

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

Re: JVLC status

Postby BraCa » 28 Apr 2010 17:55

my scenario:
VLC 1.1.pre2
VLCJ 1.1b
WindowsXP

run from eclipse TestPlayer with no problem
(I've setted the correct "jna.library.path")
with this I've also made a test with UDP,
I've passed a udp url.. udp://234.0.0.1:1234 to MediaPlayer.playMedia
udp is not implemented ? or I'm wrong something ?
in general for connect to stream I must use same method for local file .. mediaPlayer.playMedia ?

I've also try to use VLCJ 1.1c
TestPalyer run with no problem

tnx for your work sherington :wink:
Try to pass the udp url as this udp://@234.0.0.1:1234

Cheers

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 » 28 Apr 2010 18:00

I've passed a udp url.. udp://234.0.0.1:1234 to MediaPlayer.playMedia
udp is not implemented ? or I'm wrong something ?
in general for connect to stream I must use same method for local file .. mediaPlayer.playMedia ?
I'll look into this. As I said previously, most of my testing these days is for local files or files over network shares, but I will try and find some time to make sure that streaming works. Older versions of my bindings worked just fine with rtsp and I had a full client-server streaming jukebox solution going on so there's no reason it won't work again once bugs are fixed!

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 » 28 Apr 2010 18:07

1. --dummy-quiet & --no-high-priority crash vlc under linux
I have no idea what to do about that. It's not like there's a different code path for Linux (apart from setting the video surface of course).

I'll try your options and see what happens.
2. When running in my program using http file I get vlc crashing in libmemcpy3dn_plugin.so
All I can tell you is I played an HD movie being served over http via Tomcat6 and it worked just fine. I don't doubt that you do have a problem, I'm just not sure how to go about looking into it.
3. When running TestPlayer.java and running a video file I get vlc crash libvlc.so something about a libvlc_media_add_option_flag.
Please tell me the exact error message and Java stack trace if you have it.

I run the TestPlayer all the time when I test changes to my bindings, I usually play dvd images and HD game trailers and I don't see any crashes. Again, I'm sure you are having a problem but I need some more info to look at it.

Thanks for the feedback.

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 » 28 Apr 2010 18:09

Hi Sheriton,
On linux I found out that the 2 options I listed were for windows only.
Sorry, I missed this message the first time I read through.

I should probably try and make the libvlc initialisation a bit more robust to handle invalid options like this.

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

Re: JVLC status

Postby adanecito » 29 Apr 2010 07:24

Hi Sherington,

I am still testing under ubuntu 9.10 with vlc 1.1.0 git and on an intel centrino dual processor. I removed most of the options and retried a mov file and got the error message about libmemcpy3dn_plugin again and an odd error about xdg-screensaver: Window 0xxxxxxxx does not exist.

I tried setting up from the ppa webupd8 1.1.0 pre2 but got errors about pulse plugin needed to be installed but not sure where to get that. Surprised that install is broken like that.

Also, I had to add a call to setPosition to vlcj I used because I needed it for setting movie position for a slider. I am not sure in your latest release you have that.

Thx,
-Tony

MarcoM
New Cone
New Cone
Posts: 4
Joined: 28 Apr 2010 14:42

Re: JVLC status

Postby MarcoM » 29 Apr 2010 11:27

someone has made some test with stream .. udp or other .. ?
I'm not able to open a stream ..

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 » 29 Apr 2010 17:12

UDP streaming works for me if you follow BraCa's suggestion above.

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 » 29 Apr 2010 17:55

Also, I had to add a call to setPosition to vlcj I used because I needed it for setting movie position for a slider. I am not sure in your latest release you have that.
Hi,

I did not add position functionality because I couldn't work out what the position value actually was. When I listened for position changed events, I got some really really small floating point number that I couldn't make sense of.

If you can tell me what the position value actually represents, is it a percentage, is it milliseconds or whatever, then I'll get it integrated.

Cheers!

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 » 29 Apr 2010 18:54

someone has made some test with stream .. udp or other .. ?
I'm not able to open a stream ..
RTP also works for me just fine.

MarcoM
New Cone
New Cone
Posts: 4
Joined: 28 Apr 2010 14:42

Re: JVLC status

Postby MarcoM » 30 Apr 2010 14:44

I've downloaded vlcj-1.1d and with this version it works :)
with precedent version vlcj-1.1c it doesn't work :roll:

tnx

oracle
New Cone
New Cone
Posts: 3
Joined: 02 May 2010 15:56

Re: JVLC status

Postby oracle » 02 May 2010 16:19

For my project I have a Java client app that accesses data in a database. The primary focus of the app and the data has nothing to do with playing videos, but some of the data has some wmv3 videos associated with it. These vmw3 files are stored in the database as well. I've been looking for platform independent ways to play these videos in my Java client. On first research JMF was promising, but is dead and doesn't have the codecs to play wmv3 files. I installed vlc 1.1 and vlcj and got the demo program up and running and it successfully played one of my wmv3 files after I saved it to disk. The next enhancement that I want to make is to start playing the video while I'm still downloading it from the database. I saw that VLC can play streamed data, but in my case the database is not acting as a streaming server. The client pulls the wmv3 file from the database in type BinaryStream and while it is doing this I want to start playing it in another thread. What would I need to do in order for this to work? Is it possible at all?

Note that my expertise is more in Java coding and database access/management, not videos, vlc or vlcj. I'd rather not have to write something that turns the database into a RTSP server. JMF had some rudimentary capability to play BinaryStream based video, hopefully there is something there in vlcj as well. Or I can be guided into how to add this to vlcj?

Thanks in advance!

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 » 02 May 2010 21:58

These vmw3 files are stored in the database as well. I've been looking for platform independent ways to play these videos in my Java client.
The libvlc method that plays a video requires a string Media Resource Locator.

The available MRLs are on this page:

http://wiki.videolan.org/Documentation: ... Use_of_VLC

So if you can't provide data to satisfy one of those MRLs, like maybe expose your database query via HTTP, I'm not sure you can do what you want.

If I had to have a go at this myself, I'd probably try creating a Servlet that queried your database for the video data and streamed the result back.

oracle
New Cone
New Cone
Posts: 3
Joined: 02 May 2010 15:56

Re: JVLC status

Postby oracle » 05 May 2010 18:58

So if you can't provide data to satisfy one of those MRLs, like maybe expose your database query via HTTP, I'm not sure you can do what you want.
Hi Eduardo, I did some more research and instead of fetching the video from the database into my Java client app using JDBC and then somehow passing it to vlcj, I followed your suggestion and found a way to expose the video stored in the database through HTTP. It's some tricky database code, but it works. The really cool thing for me was that I tried the vlcj-1.1f download, because I had messed up my vlcj-1.1d env and noticed that a new "Connect to Media" button has been added. This allowed me to try out the HTTP based solution in the test player without having to write any code myself. It worked beautifully!

Thanks for providing the vlcj functionality. It will allow me to embed videos that are stored in a database in my Java client app. It isn't truly streaming the video, but it does a progressive download, so it will start playing the video as soon as it has received some of the data.

gnosygnus
Blank Cone
Blank Cone
Posts: 30
Joined: 02 May 2010 19:34

Re: JVLC status

Postby gnosygnus » 06 May 2010 08:26

I discovered an odd issue, but it may be a boundary case.

If you call setMedia with a String that has a non UTF-8 encoding (windows-1252), then the file fails to play with a "could not find file" error.
[redact]However, if you convert it to UTF-8, then the file plays successfully.[/redact]

I discovered this while retrieving fileNames from a MySQL database. Even though everything was set as UTF-8, the fileName I passed to vlc-j would not work.
Once I converted explicitly to UTF-8, my problem was fixed.

For anyone else who runs into the same issue...

Code: Select all

String ConvertToUtf8(String s) { Charset oldCharset = Charset.forName(Charset.defaultCharset().name()); Charset newCharset = Charset.forName("UTF-8"); // needed for JNA (at least on Windows) ByteBuffer oldByteBuffer = ByteBuffer.wrap(s.getBytes()); CharBuffer oldCharBuffer = oldCharset.decode(oldByteBuffer); ByteBuffer newByteBuffer = newCharset.encode(oldCharBuffer); return new String(newByteBuffer.array()).trim(); } private void setMedia(String media, String... mediaOptions) { media = ConvertToUtf8(media);
Edited: Does not always work. use java -Dfile.encoding=UTF-8. see below
Last edited by gnosygnus on 08 May 2010 05:05, edited 2 times in total.

oracle
New Cone
New Cone
Posts: 3
Joined: 02 May 2010 15:56

Re: JVLC status

Postby oracle » 07 May 2010 19:09

As stated earlier I have a java app where most of the UI is dealing with displaying data that it retrieves from a database. Only every now and then the fetched has data something to do with videos. Whenever I do want to play a video I don't want to do this in the main window of my app. I popup a 2nd window. Normally I would use a JDialog for this, but vlcj won't play in a JDialog. So instead I open up a 2nd window by creating a new JFrame. Once the end-user is done playing the video he closes the 2nd window.

To cleanup when the video window is being closed I add the following window listener:

Code: Select all

addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { if ( mediaPlayer != null ) { mediaPlayer.release(); } if ( mediaPlayerFactory != null ) { mediaPlayerFactory.release(); } setVisible(false); dispose(); } });
This seems to be the recommended way of doing things. However, on closing of the window that played the video I intermittently get the following exception:


JNA: Callback uk.co.caprica.vlcj.runtime.windows.WindowsMouseHook@754fc threw the following exception:
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at uk.co.caprica.vlcj.runtime.windows.WindowsMouseHook.callback(WindowsMouseHook.java:185)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414)
at com.sun.jna.Function.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:344)
at com.sun.jna.Function.invoke(Function.java:276)
at com.sun.jna.Library$Handler.invoke(Library.java:216)
at $Proxy2.GetMessage(Unknown Source)
at uk.co.caprica.vlcj.runtime.windows.WindowsMouseHook$MouseHookThread.run(WindowsMouseHook.java:301)


It seems that once I've released the player, another thread every now and then is still reacting to mouse events. Is there a way to modify the release player code such that it first removes the mouse listeners? Or is there something that I should be doing differently?

Note that I've only tried this on Windows and all of this is based on vlcj-1.1f.

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

Re: JVLC status

Postby adanecito » 07 May 2010 19:39

Hi All,
Are people still having issues with fullscreen not working? Is that a vlcj issue or a build of 1.1? I am having that issue and not sure if it is an issue with vlcj or vlc 1.1.x.

Also, it seems for getting the time that the video is running that is might be different value for Windows versus Linux. Not sure if that is a difference in Windows versus Linux or vlcj.

Finally Sherington how are you building 1.1.X for Linux testing? I need to get the latest so's and not sure how to setup for a build that would work. Since you are doing that I figured you might be able to direct me to some instructions that work for Ubuntu.

Thanks,
-Tony


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 23 guests