New Library - VLCJVideo


#1

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 direct.java and headless.java 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!


#2

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


#3

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


#4

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


#5

From https://www.gnu.org/licenses/gpl-faq.html

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:


#6

As per LGPL - https://www.gnu.org/licenses/lgpl-3.0.en.html

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 - https://github.com/caprica/vlcj#license 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 - https://github.com/icanhazbroccoli/VLCJVideo/blob/master/license.txt


#7

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


#8

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.


#9

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[]?

Cheers!


#10

Sorry, no benchmarks.

About formats: https://www.videolan.org/vlc/features.html

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

About options: https://wiki.videolan.org/VLC_command-line_help/
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);

#11

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.

Thks


#12

I really don’t know. On Linux, to grab a usb camera is as easy as
video.openMedia("v4l2:///dev/video0");
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.


#13

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!


#14

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.


#15

Thanks! …


#16

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.