VLCJ in OpenGL / LWJGL

thats because you never tried to write video playback which

  • runs on every platform
  • without having to install anything
  • running decent video, fluently, in decent quality
  • in opengl
  • while being able to legally redistribute it: codecs and libraries are licensed

I have made and took part in countless thread these last years because of this.
Even jme has currently no video playback because stuff either sucked so hard or had implementing/licensing issues.

I talked about it with the creator of vlcj again per mail, as we talked before.
My version is already using vlc 2 and stuff
yeah the vlcj license is still old, he is considering offering 2 separate licenses soon

anyway, its all good.

And what about the audio syncing?

Cas :slight_smile:

seems perfect
let me render a long theora video and have a look
btw: TheoraConverterDotNet is great.

22min show
576x432
Filesize @ Quality 9 (video & Audio) -> 243MB

Perfect sync and all.

Going to test some more on weaker machines, but I expect performance to be like a normal mediaplayer / like VLC
So yeah, its good.

Still need to test on the other OS’ of course

Syncing is handled by the native library. The Java program just gets notified when a new frame has been decoded and displays it.

What is used for audio playback? OpenAL?

since we dont do anything and its native code, I guess on windows it uses DirectSound
but not sure.

it uses whatever the vlc player uses of course

Ah I see, so it actually handles the sound playback. Not so good if your frame display rate doesn’t match the video rate. This particular problem is a rather more complicated issue than it looks at first. The video display needs to be actually triggered by audio playback, not vice versa.

Cas :slight_smile:

like I said, I watched a 20min show without desync.
I added a Display.sync(video framerate) - but it doesnt seem to make difference.
One of my guys tried it on a weak netbook with a intel gma
Java2D worked (although playing HD on a netbook is of course slow by itself)
LWJGL didnt work and he says its probably because the texture isnt power of 2
matters little as we render it ourself

I think having a 512x256 and a 1024x512 for each video is the best
going to test the gpu’s texture size before and then playing whatever is more appropriate.

This can be easily fixed. You only have to change the call to glTexImage2D to create the texture with a power-of-2 size and change the texture coordinates when rendering to correct values ((float)videoSize / textureSize; for both width and height). The call used to update the texture with new video data, glTexSubImage2D, can take non-power-of-2 since it only updates a subsection of the texture.

Any chance somebody could reboot this, IE: Make some kind of library for this, I really need something like this, but I dont want to have to manually code a vlcj port.

Swift

Just because of the lack of a Java video player, Riven, our forum moderator, built a tool for video Playback: YUNPM (Why you no play Movies)

Thanks, been looking for ages, but it seems google doesn’t pick that kinda stuff up, its pretty much what I needed.
Swift

There is also a GStreamer solution around here. Depends whether you need the extra features GStreamer brings in over FFMPEG / libav. Incidentally, the video playback in JavaFX is GStreamer based - let’s hope that as it develops we get nice easy access to a built in media library!

VLCJ was mostly abandoned by us because of GPL licensing issues.
Similar problem with YUNPM, however its the codecs contained, that are GPL, not the code.
GStreamer doesn’t have these problems.