New Library - VLCJVideo

Hello again.
I bring a VLCJ binding for Processing, based on the previous work by Oleg Sidorov.
It was a 2 days work. That means the original library is awesome :star_struck: and I only had to update the code to the latest VLCJ version.
I did it with a lot of help from and examples, and it’s working (with more luck than wisdom from me).
The point is I’m no expert on VLCJ (in fact I first saw it 2 days ago) and maybe I’m doing all wrong. Is there someone who knows something to review this code?

Happy New Year to all!


Good work! VLCJ is a great library. But please fix your license notice to be GPL!

Sorry, I don’t think I can do it. The original code is LGPL.

You can do (because LGPL can always become GPL) and have to (because VLCJ itself is GPL).


It would be nice to try out the LGPL on each library for a while, see whether it helps, and change back to the GPL if the LGPL didn’t help. But this is not feasible. Once we use the LGPL for a particular library, changing back would be difficult.

Beside, I’m not the library original owner. I don’t have the right to change license.

If the LGPL original license is illegal for some reason, we should call a lawyer. :nerd_face:

As per LGPL - GNU Lesser General Public License v3.0 - GNU Project - Free Software Foundation

you may convey a copy of the modified version:

b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.

Yes it is and no we shouldn’t. You should just alter the license file to respect the license of VLCJ - GitHub - caprica/vlcj: Java framework for the vlc media player You could decide to keep the existing license header on the source code you have added / modified, but the overall license of your library is GPL … period!

Also, check the license file (GPL!) of the project you forked - VLCJVideo/license.txt at master · osdrv/VLCJVideo · GitHub

Thanks a lot for sharing your knowledge. I really want to do the RIGHT THING.
No problems with GPL, on the contrary.
License changed.


No problem! I wasn’t intending to take your project announcement on a detour :smile: In fact, was at first hopeful that the license for VLCJ had been changed! One reason I ended up as maintainer of the GStreamer bindings rather than using VLC was because of VLCJ’s use of GPL (even though I’m a fan of GPL in general).

It is also important that anyone using your library knows that they have to follow GPL conditions to do so.

Thank you :slight_smile: Happy 2019!

Could you compare this approach with the standard video player? Are there performance differences? Can they play different formats? Transparency? Effects? What could you do with options[]?


Sorry, no benchmarks.

About formats:

VLCJVideo output to a PImage, just like standard Video. You can manipulate frames the same way.

About options:
It look like vlc command line is underused and a lot of the info you find online is obsolete, but you can use VLC filters like this:

String[] options = {"--video-filter", "sepia:rotate{angle=180}:wave"};
video = new VLCJVideo( this, options);

How does this relate to grabbing images from a camera other than a usb webcam?
I have left several posts in 2017-2018 trying to understand why processing recognizes all usb cameras connected
But only webcams listed under device manager work and then only for specific resolutions. Cameras listed as image devices under game controllers and video
Do not work even when listed in device manager at any resolution ,but work fine with other camera utility software.

The last forum answer acknowledged the issue but have not been fixed to my knowledge.


I really don’t know. On Linux, to grab a usb camera is as easy as
It really depends on vlc ability to access devices. Since I only have a “normal” webcam to test, I can try on Windows but I will not have a definitive answer to you.
Try to capture your devices with vlc.

Thank for your quick reply.
Any help with how to do that in Processing?
Do i need to install the VLC library you mentioned at the begginning ?

thanks again!

1 Like

If you want to try VLCJVideo, remember that it’s just a binding to VLCJ who is also a binding to VLC libs.
Install VLC Media Player (if you don’t have it already) open it and try to capture the device you want to use. If you can do it, that’s good news. Now you need to discover how to do it at command line (in the previous example I gave you, I can capture my webcam with the command vlc v4l2:///dev/video0).
If you can find that, you have your solution. :smiley:
If you can’t capture your camera with VLC, try VLC forums.

Thanks! …

Another update:
Now VLCJVideo can also play audio files.
duration() gets media length at parsing, instead of around after 2 seconds of play.
I also added an example of how to use vlcj AudioMediaPlayerComponent to play audio.


More than a year old post, and my first post here also. Hope you are still around here.

I am using the VLCJVideo lib for a personal media player, very easy to implement and understand, good job, thanx mate.

Now i am developing an SMTPE time code clock, relying in the time() function. But i found that time() does not update every time i query it. And because this, my seconds and frames calculations are not very precise.

As on your last post, you improved the duration() function, with a similar problem that time() shows. I wonder if you can help me to get time() updated every time is queryed.

Thanx again, to you and to anyone that can help me on this.

Can you provide a very brief example sketch of what problem you are talking about? Just something that access the method you mean, in the way that you mean, and nothing else. I glanced at the library code here

but I’m not clear what specifically you are trying to accomplish. It seems likely that how long time() is updated may be defined by the underlying vlcj-4, and not by these bindings – but there could be workarounds using millis(), depending on what specifically you are trying to do.

Hi, I guess it was asked, but I didn´t find the answer.

How to I install the VLCJ in order to make processing run sketches with this library?

I´m running windows, installed [VLCJVideo] from the library manager and downloaded the but I don´t know where to puto those files

thanks a lot

If you installed it from library manager, you don’t have to do anything. All jars are at sketchbook/libraries/VLCJVideo/library. Try an example.
By the way, VLCJVideo still uses vlcj-4.1.0 (included).