B4J Question B4JVLCj Library - Exposing Video Properties

RichardN

Well-Known Member
Licensed User
Longtime User
I have just been playing with the excellent library B4JVLCj by @moster67 that allows you embed VLC media player within a B4J desktop application. Within certain limitations it all seems to work as advertised.

In trying to push it a little further I would like to extract the Video Codec name or fourCC value that the desktop version of VLC can tell you at the click of a mouse. The author hints that other properties are exposed by the lib but need to be addressed by the Java Object method....

Exposing Video Proerties:
Dim jo As JavaObject = vlc.player
    
Dim fps As Float = jo.RunMethodJo("getMp", Null).RunMethod("getFps",Null)

I have looked at the Java Docs but there seems to be no access to any of the principle video properties other than Frames/Sec. Has anyone explored this and been successful ?
 

RichardN

Well-Known Member
Licensed User
Longtime User
Thanks @Star-Dust I missed that one. It does however throw an exception... I am a Java numpty...... perhaps my RunMethod call is incorrect?

B4X:
Dim CodecDescription As String = jo.RunMethodJo("getMp", Null).RunMethod("getCodecDescription",Null)
Error occurred on line: 130 (Main)
java.lang.NullPointerException
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:370)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:181)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.shell.ShellBA$1.run(ShellBA.java:63)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
at java.lang.Thread.run(Thread.java:750)
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.shell.ShellBA$1.run(ShellBA.java:63)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I think you need to pass some parameters, including an integer value that you get from another class that I don't think is included in the do @moster67 wrap. Unfortunately I don't have the time to elaborate on it at the moment
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
Thanks @Star-Dust. I suspect you have to specify which video-stream you are working with although most videos will only have stream# 0.

I will meditate a little more!
 
Upvote 0
Top