Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  VLCJ in OpenGL / LWJGL  (Read 12854 times)
0 Members and 1 Guest are viewing this topic.
Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #30 - Posted 2012-02-29 10:50:11 »

The woe of using native code Sad

Cas Smiley

Offline Cero
« Reply #31 - Posted 2012-02-29 15:31:48 »

The woe of using native code Sad

yes, well, we are outta options
but once someone with OpenGL skill can make it work, its a theora player that works great

Offline theagentd
« Reply #32 - Posted 2012-02-29 16:12:52 »

I know OpenGL. Give me a buffer with frame data and I'll put it on screen.

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Danny02
« Reply #33 - Posted 2012-02-29 16:32:23 »

why not use https://github.com/pirelenito/MovieGL
seems like a solid opengl movie player based on JMF, I know that this doesn't support many formats, but there a plugins for it like jffmpg(instead of fobs, what is suggested by this project).
One wouldn'T have any natives libs, what would be great.
Offline Cero
« Reply #34 - Posted 2012-02-29 16:36:58 »

I know OpenGL. Give me a buffer with frame data and I'll put it on screen.

I was hoping you would show up.
well knock yourself out, that eclipse project should run
the jme example is there, I'm sure you can get this to work

Offline theagentd
« Reply #35 - Posted 2012-02-29 17:28:32 »

Took me about 5 minutes...



http://www.java-gaming.org/?action=pastebin&id=23

Myomyomyo.
Offline Cero
« Reply #36 - Posted 2012-02-29 17:38:00 »

Took me about 5 minutes...

I knew it would =)
Great !

Offline theagentd
« Reply #37 - Posted 2012-02-29 17:59:21 »

Well, if you give me a ByteBuffer containing perfectly formatted RGB data and tell me to display it with OpenGL...

The code is pretty stupid, it just uploads the data every single frame instead of only when it changes, but it should get you going.

Myomyomyo.
Offline nsigma
« Reply #38 - Posted 2012-02-29 19:38:05 »

Then there is only license problems ... Make your code GPL, or at least that part that uses/communicates with VLCJ

hmm ... yeah ... that doesn't sound exactly legit!  Wink

Luckily, you missed out the important news of the month.  libVLC 2.0 is now LGPL.  Just need to convince the developer of VLCJ to follow suit ...

Slightly OT - I've finally got around to looking at forking out the GSVideo code from Processing to enable bundling of GStreamer binaries, so that'll be another LGPL solution.  I was almost not going to bother since it's pretty easy to install a system version on Linux and Windows, but Mac on the other hand is a PITA.  I'm also considering VLC as a backup video lib in Praxis.

Hm, okay, how are the buffer blits synced? You never request a new frame, and without any request, it must be running on another thread, which will cause lots of tearing as the buffer can be modified during upload.

One way to handle that might be to fork the code for DefaultDirectMediaPlayer, use two native buffers, and swap between them using the lock/unlock callbacks.  That way you can let VLC get on with writing to one buffer while you make use of the other.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #39 - Posted 2012-02-29 19:46:30 »

I don't know why you are all struggling so much when bobjob already made a video player applet that just runs the ffmpeg exectuable in the background and reads its data from an InputStream..... Roll Eyes

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #40 - Posted 2012-02-29 19:57:45 »

I don't know why you are all struggling so much

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.


Then there is only license problems ... Make your code GPL, or at least that part that uses/communicates with VLCJ

hmm ... yeah ... that doesn't sound exactly legit!  Wink

Luckily, you missed out the important news of the month.  libVLC 2.0 is now LGPL.  Just need to convince the developer of VLCJ to follow suit ...

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.

Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #41 - Posted 2012-02-29 20:48:52 »

And what about the audio syncing?

Cas Smiley

Offline Cero
« Reply #42 - Posted 2012-02-29 21:01:55 »

And what about the audio syncing?

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

Offline Cero
« Reply #43 - Posted 2012-02-29 21:49:32 »

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

Offline theagentd
« Reply #44 - Posted 2012-03-01 10:53:14 »

And what about the audio syncing?

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

Myomyomyo.
Offline davedes
« Reply #45 - Posted 2012-03-01 18:54:42 »

What is used for audio playback? OpenAL?

Offline Cero
« Reply #46 - Posted 2012-03-01 18:58:11 »

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

Offline princec

JGO Kernel


Medals: 284
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #47 - Posted 2012-03-01 20:10:44 »

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 Smiley

Offline Cero
« Reply #48 - Posted 2012-03-01 21:20:17 »

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.

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.

Offline theagentd
« Reply #49 - Posted 2012-03-02 11:37:10 »

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.

Myomyomyo.
Offline Swift

Junior Newbie





« Reply #50 - Posted 2013-01-20 16:45:56 »

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
Offline matheus23

JGO Kernel


Medals: 98
Projects: 3


You think about my Avatar right now!


« Reply #51 - Posted 2013-01-20 16:50:01 »

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.

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)

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Swift

Junior Newbie





« Reply #52 - Posted 2013-01-20 17:07:22 »

Thanks, been looking for ages, but it seems google doesn't pick that kinda stuff up, its pretty much what I needed.
Swift
Offline nsigma
« Reply #53 - Posted 2013-01-20 19:44:09 »

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!

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Cero
« Reply #54 - Posted 2013-01-20 19:47:21 »

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.

Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (55 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (247 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!