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 » 07 May 2010 19:42

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?
This does indeed look like a race condition in the new Windows-only mouse hook handling.

I will look at tightening that up if possible. At the very least I can probably swallow that exception.

In the meantime I've added an explicit release() method to the WindowsCanvas that you can call during your clean-up, this might help (release this first).

The windows mouse hook stuff is all very experimental and there may well be some subtle threading and synchronisation issues I'm not aware of.

I'm a bit stuck at the moment because I don't have a working vlc to test against.

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 » 07 May 2010 19:54

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.
I've seen other posts in this forum (and the libvlc header file has a comment to this effect) where basically it boils down to if you embed the video in your own application window you can't have full-screen - you have to do something like reparent your video surface to the desktop window rather than your own window, then toggle full-screen. I have no idea how to do that in Java whatsoever so I'm happy to hear suggestions.

Instead of using vlc's full-screen, I use Java's graphics device functionality to set full-screen exclusive mode (seems to work just fine on Linux, but not on Windows where it looks emulated to me). If you check the vlcj WIKI pages it tells you what I did for full-screen and what the issues are.
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.
There is no different code path for Windows vs Linux in vlcj for this. I'm not sure which time you're referring to - I've not noticed it not working myself.
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.
I installed 1.1.0pre2 from the webupd8 PPA and that worked fine.

I installed 1.1.0pre3 from the webupd8 PPA and immediately wished I hadn't. It hosed my system and I've had nothing working since that point.

I then cleaned everything up, successfully built ffmpeg, x264 and the 1.1.0pre3 from the videolan source bundles from scratch and all I see now is unexplained fatal VM crashes. I have no idea why it's no longer working. The JVM just dies without any libvlc or java errors being reported.

I wouldn't recommend doing it, but good luck.

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 23:59

Hi Sherington,

Thanks for the prompt feedback. The fullscreen used to work fine with vlcj before 1.0.6 and I guess they made some changes so it does not operate in an embeded app. I suspect the perl bindings are now not working for fullscreen also if that is the case. I heard they had crashing of the vlc executable when fullscreen was enabled for 1.1.x and reached the end of a video for 1.1 so maybe they made a change.

I will update tonight to your latest vlcj version and do some retesting.

Again many thanks for your help.

-Tony

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

Re: JVLC status

Postby gnosygnus » 08 May 2010 05:44

Hopefully this is worthwhile to someone, but to continue an earlier post....

I encountered an issue on Windows wherein loading UTF-8 fileNames from a UTF-8 MySql database would not always work.
I saw that Charset.defaultCharset().name = "windows-1252", so I thought converting the string to UTF-8 would work.
Though this worked for some fileNames, I've discovered that it doesn't work for others.

The problem seems to be the .getBytes() call. I think JNA is using .getBytes() which will return *wrong* values for windows-1252, but *right* values for UTF-8
Note that .charAt works correctly in both defaultCharsets, as they always return the same value in both windows-1252 and UTF-8.

For example, I'm using a Japanese character (I have no idea what it is)

When Charset.defaultCharset().name = "UTF-8", I get
.charAt(0) 20304
.getBytes[0] -28
.getBytes[1] -67
-28, -67 is the correct DBCS (and how the file is named on my drive). vlcj does find the file

When Charset.defaultCharset().name = "windows-1252", I get
.charAt(0) 20304
.getBytes[0] 63
63 is obviously ? and vlcj will not find the file

I'm still relatively new to Java, so I don't know if there is a real way to re-encode a windows-1252 string as UTF-8 such that a getBytes() works. From what I've read, there is no programmatic way. My earlier example definitely does not work.

What does seem to work is to set the jvm encoding at startup.

Code: Select all

java -jar myjar.jar -Dfile.encoding=UTF-8
So far this works for all files I've encountered. However, I am seeing the following errors outputted to my console.

libdvdread: Using libdvdcss version 1.2.10 for DVD access
libdvdread: Could not open C:\folder\?????.flac with libdvdcss.
libdvdread: Can't open C:\folder\?????.flac for reading

vlc continues fine though, and as I said, the file does play. Stability is fine as well.
Does anyone have any idea about the error messages? I've also seen variants of these messages crop up randomly when calling .playMedia

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

Re: JVLC status

Postby adanecito » 08 May 2010 06:53

Hi Sherington,

Your latest vlcj no longer compiles for me since it needs some version I have not seen of jna to do some mouse capture events. Where did you get your jna library and what version is it? I am using 3.2.4 which I thought was the latest support for jna.

And with these changes you made do you support Linux any longer?

Thx,
-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 » 08 May 2010 07:48

Your latest vlcj no longer compiles for me since it needs some version I have not seen of jna to do some mouse capture events.
Maybe you're missing "platform.jar" from JNA? The lib folder in svn has this and I did update the quick start on the WIKI to say this was needed but I guess I probably should add release notes when something like this changes.
And with these changes you made do you support Linux any longer?
All my own development targets Linux.

I only grudgingly write code that supports Windows, and in this instance the bindings for Windows need some hacks to get mouse and keyboard events delivered - Linux doesn't need those hacks.

So yes, of couse, Linux is still supported and is the preferred platform.

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

Re: JVLC status

Postby adanecito » 08 May 2010 08:44

Hi Sherington,

No problem I never had to use the platform.jar before so never included it in my distribution.

I am using both Windows and Linux now so I really appreciated your work on both. Remi would have heart attack if he knew I am working on Linux also since he thinks I am windows only. I can change my spots from time to time :-)

-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 » 08 May 2010 08:52

Hi Sherington,
Okay I now know what happened. I use 3.2.4 and you are using 3.2.5 which has the new platform.jar.

I will upgrade.

Thanks,
-Tony

hzaman
New Cone
New Cone
Posts: 1
Joined: 06 May 2010 10:15

Re: JVLC status

Postby hzaman » 08 May 2010 10:41

Hi Sherington,

First thanks for the vlcj. Currently I am working on a project, where I need to start a RTSP stream file from a certain position ( like after 10 sec/min). I am using vlcj to make the player for the RTSP stream. My questions:

1. Can I use vlcj to play RTSP stream? I saw someone that RTP/UDP works.
2. Is it possible to do seeking with vlcj (like getting the current time using get_time/get_position and then using set_position or set_position to start the stream from that certain time)?

May the questions are not totally relevant with the vlcj project, but any answer will be appreciated. Thanks in advance.

H Zaman

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

Re: JVLC status

Postby adanecito » 08 May 2010 10:50

Hi Sherington,

I am trying your latest release and I am running into some issues.

1. I Use JInternalFrames so I want to not use your Full Screen Strategy for now and just start out without full screen capability. I am not sure how to use it with that in mind.
2. I get an error during runtime about mouse listener but I do not create one like in your test example so surprised by the following exception:
Could not initialize class uk.co.caprica.vlcj.runtime.windows.WindowsMouseHook

Let me know how to work around these issues I did read your wiki.

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 » 08 May 2010 11:16

1. I Use JInternalFrames so I want to not use your Full Screen Strategy for now and just start out without full screen capability. I am not sure how to use it with that in mind.
Just use the DefaultFullScreenStrategy and simply don't call the full-screen methods on the media player instance in your client code or write a FullScreenStrategy implementation that does nothing and use that.
2. I get an error during runtime about mouse listener but I do not create one like in your test example so surprised by the following exception:
Could not initialize class uk.co.caprica.vlcj.runtime.windows.WindowsMouseHook
I need a more detailed error message and/or the full Java stack trace to help you. I suspect there's something going wrong for you with the native Windows call to install the mouse hook.

If you create a WindowsCanvas (rather than Canvas) it will attempt to install the hook whether or not you add a mouse listener. Maybe it's a good idea for me to change the bindings to only install the hook when at least one listener is added. It complicates the implementation but I'll think about. Even so, it should not be causing an error unless you're using WindowsCanvas under Linux or something failed in the native call.

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 » 08 May 2010 11:20

1. Can I use vlcj to play RTSP stream? I saw someone that RTP/UDP works.
vlcj can play whatever vlc can play. I've played RTSP/UDP/HTTP successfully with my bindings.
2. Is it possible to do seeking with vlcj (like getting the current time using get_time/get_position and then using set_position or set_position to start the stream from that certain time)?
If vlc can seek in the stream, then so can vlcj. The media player object has implementations for all those methods that you asked about.

Download the vlcj test player (assuming you're using libvlc 1.1.0), open a streaming URL, and try the seek controls to find out!

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

Re: JVLC status

Postby adanecito » 08 May 2010 11:31

Hi Sherington,

I just set the fullscreen strategy to null for now. For the mouse issue I discovered it had to do with using a WindowsCanvas object so I used a regular Canvas object for now and that resolved the issue.

Now I just have to figure out why when creating a MediaPlayer object the app hangs waiting for the object to be created. Since it is 3:31AM here I am going to get some sleep and figure out tomorrow night why again creating a MediaPlayer seems to take forever.

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 » 08 May 2010 11:50

Now I just have to figure out why when creating a MediaPlayer object the app hangs waiting for the object to be created.
Well that's the point at which the media player tries to initialise the native libvlc library. Maybe you passed an invalid option or something or have some other native issue.

Next release of vlcj is going to add comprehensive logging to try and help.

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 » 08 May 2010 17:23

Now I just have to figure out why when creating a MediaPlayer object the app hangs waiting for the object to be created.
Since 1.1.x is fubar for me, I did some more work on the 1.0.6 bindings - while doing that I saw a hang during startup because of this:

Code: Select all

Native.setProtected(true);
I removed that and it didn't hang any more. Maybe that will help you.

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

Re: JVLC status

Postby adanecito » 08 May 2010 19:18

Hi Sherington,

Thanks for the suggestion but I did not find it in the java bindings anywhere. Where did you find it?

I understand about 1.1 but if you notice vlc no longer builds 1.0.x any longer. That is why I finally moved to 1.1.x and like you I am not super pleased but then it has not even been released yet so what we download is a risk anyway.

I really wished the vlc team would create so's for Ubuntu we can test like they do for windows. That way when we test we have some hope they might work.

-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 » 08 May 2010 19:50

Okay I found one major issue. Seems the following line of code in setMedia crashes the jre if you use a string containing http.

libvlc_media_t mediaDescriptor = libvlc.libvlc_media_new_path(instance, media);

I am wondering about the new mrl classes and why they were added. Since your testing uses files instead of streaming I am wondering if this issue was missed somehow or the mrl classes have to be used in some manner.

Regards,
-Tony

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

Re: JVLC status

Postby gnosygnus » 09 May 2010 00:09

For anyone interested... I figured out how to get subtitle/audio descriptions for all tracks.
For example, libvlc_video_get_spu_description returns a libvlc_track_description_t. It will return back id and name for item0 but only a pointer to item1.
To get the description for item1 (and others)

* Change libvlc_track_description_t

Code: Select all

public class libvlc_track_description_t extends Structure { public static class ByReference extends libvlc_track_description_t implements Structure.ByReference {} public int i_id; public String psz_name; // public Pointer p_next; public libvlc_track_description_t.ByReference p_next; }
* Add new method

Code: Select all

public String getSpuDescriptions() { StringBuilder sb = new StringBuilder(); libvlc_track_description_t trackDescription = libvlc.libvlc_video_get_spu_description(mediaPlayerInstance); while (trackDescription != null) { sb.append(trackDescription.psz_name + "\n"); trackDescription = trackDescription.p_next; } return sb.toString(); }
This returns the following result:

Code: Select all

Disable Track 1 - [English]
I have to admit: JNA is pretty nice.

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 » 09 May 2010 08:14

Hi,
Okay I found one major issue. Seems the following line of code in setMedia crashes the jre if you use a string containing http.
libvlc_media_t mediaDescriptor = libvlc.libvlc_media_new_path(instance, media);
That's odd. I do test with HTTP now and it works for me. I had a failure a while back because it tried to parse the meta data on HTTP, but I removed that some time ago.
Thanks for the suggestion but I did not find it in the java bindings anywhere. Where did you find it?
It was in my test player class.
I understand about 1.1 but if you notice vlc no longer builds 1.0.x any longer.
I got 1.0.6 from the Ubuntu Universe repository, although it causes me some issues at least I have something I can use.

(From what I can see, 1.0.6 is much more like 1.1.0 and less like 1.0.5.)

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 » 09 May 2010 08:16

Hi,
For anyone interested... I figured out how to get subtitle/audio descriptions for all tracks.
I integrated that, thanks, and it will be in the next release.

Do you know if that structure has to be freed natively?

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 » 09 May 2010 08:55

I have updated bindings for vlc 1.0.6 including back-porting a lot of the media player features and the example video player from 1.1.x for the 1.0.6 bindings. You get chapter controls, volume controls, sub-title controls etc.

I have tested the following scenarios on Linux and these work for me using the example video player:

1. Play local files, DVD iso images, seeking works
2. Play HTTP streams, Tomcat 6 serving, HD mp4 videos, seeking works
3. Play RTP streams, vlc 1.0.6 serving, HD mp4 videos

A couple of things work differently with 1.0.x as compared with 1.1.x:

1. On 1.0.x, mouse and keyboard events are not delivered from the video surface, even on Linux, while the video is playing
2. On 1.0.x, native full-screen works if you double-click the canvas, I suspect the full screen API functions will also work on 1.0.x

I will try and find a solution for #1 in a later release.

I am trying to stabilise the bindings so please feedback any issues.

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 » 09 May 2010 08:57

vlcj contains a simple video player implementation built using Swing/AWT, and I use this for testing.

I have discovered a new issue that I am really struggling to solve. I did not see this issue with vlc 1.0.5, nor with vlc 1.1.0pre2, but it is present when running the same Java code against vlc 1.0.6 and vlc 1.1.0pre3. I'm not saying this is a vlc fault I'm just describing my circumstances.

The problem goes like this...

1. Start the test player
2. Use file or stream dialog to open a media source
3. Video starts playing
4. Use file or stream dialog, this time hit cancel (or choose something, it doesn't matter)
5. => Fatal JVM failure, with the text below dumped to the error console

(If you never start a video playing, you can open and cancel as many dialogs as you want and it doesn't crash.)

Code: Select all

[????????] x11 video output error: X11 request 20.0 failed with error code 3: BadWindow (invalid Window parameter) X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 20 (X_GetProperty) Resource id in failed request: 0x4400042 Serial number of failed request: 2673 Current serial number in output stream: 2673
The fatal JVM failure is most likely as a result of an unhandled exception condition in the native code.

This happens as soon as the dialog box closes, and is 100% repeatable and I have no idea what to do about it.

I can play movie after movie without any issues if I don't use a dialog box and do it programmatically instead.

Anyone have any ideas?

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 » 09 May 2010 10:06

Ah, regarding BadWindow I found this...

viewtopic.php?f=13&t=74084

I'm not sure what I can do but that's the issue right there.

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

Re: JVLC status

Postby Rémi Denis-Courmont » 09 May 2010 10:25

That error message (x11 video output error: X11 request x.y failed with error code z) was removed from the VLC 1.1 so I have to doubt that it happens in VLC 1.1.0-pre3.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

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 » 09 May 2010 10:44

That error message (x11 video output error: X11 request x.y failed with error code z) was removed from the VLC 1.1 so I have to doubt that it happens in VLC 1.1.0-pre3.
What I was meaning was that when I used pre3 and followed the sequence of events I described above, I still see a fatal VM crash. In the pre3 case I get no error message whatsoever, it just terminates the application. So I went back to 1.0.6 and tried the same and I got the error message described above. I was assuming it was the same thing.

Admittedly it might not be the same error, I think I have a deeper problem.

I think my biggest problem was that at the time I was integrating vlc 1.1.x I accepted a load of package updates from Ubuntu and the webupd8 vlc packages updated too - since that point in time things have stopped working for me.

So yes these problems might be of my own making.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests