Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java and Video: Never works.. but how does SWT implement the browser?  (Read 3083 times)
0 Members and 1 Guest are viewing this topic.
Offline Serethos

Junior Devvie




Java games rock!


« Posted 2012-10-18 10:49:00 »

Hi all,

as so many others I hunted after a way to play a video in a java application across the platforms mac osx, linux, win. The frameworks like Xuggle, JMF etc are either outdated, dead or plainly do not work properly. I now came across a suggestion to use SWT and just load via its browser component a webpage that embedds a video. I tried an example using the windows SWT and loaded a youtube page - it worked flawlessly.
Now there are two questions coming to my mind: what is SWT using that it can display e.g. the youtube video stream without problems and can I use this library on its own to just embed a video and not a whole webpage?

Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 834
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2012-10-18 10:50:04 »

http://www.java-gaming.org/topics/java-media-player/27100/view.html Pointing

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline nsigma
« Reply #2 - Posted 2012-10-18 11:17:20 »

Now there are two questions coming to my mind: what is SWT using that it can display e.g. the youtube video stream without problems and can I use this library on its own to just embed a video and not a whole webpage?

It would appear to be this? http://www.eclipse.org/swt/faq.php#whatisbrowser.  So, theoretically possible to use, but you'd need the SWT binaries.  JavaFX's WebView is similar.  You could embed one video by just creating a webpage that has the YouTube embed code and nothing else.

However, unless you have a very particular reason to want to use YouTube, don't!  Wink Take Riven's advice and check out that thread.  There's also this.  Use whichever works best for you - there are pros and cons of both.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 425
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2012-10-18 12:06:55 »

JavaFX supports video playback, and it's the new hotness in town.

Cas Smiley

Offline nsigma
« Reply #4 - Posted 2012-10-18 12:17:16 »

JavaFX supports video playback, and it's the new hotness in town.

Actually, not that different to the old, seen as it's a wrapper to a locally installed GStreamer!  Wink  Having said that, having GStreamer code accessible in any Java install by default would be great and save all that library loading nonsense I ported from Processing.  Lets just hope there's a way to access all the power underneath, as at the moment a lot of it is locked away in JavaFX.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Cero
« Reply #5 - Posted 2012-10-18 13:24:47 »

So if you search this forum you will come across a lot of threads by me, since I really wanted this feature and looked everywhere.

Today, the best 3 options are
- aforementioned YUNPM - which has mild license issues with the codecs, you may have to recompile FFMPEG
- VLCJ - which is still LGPL, so again a legal issue
- and gstreamer-java, in this thread we created a player for lwjgl that uses gstreamer and, if you delete the plugin files / codecs, has no license issues
and it works beautifully

- there is of course Xuggler which is... very complicated to say the least and not sure about legal problems - and I have yet to see "long" action videos, played and synced with Xuggler

- JTheora should be the default option, if it didnt suck so hard, since its a pure java way of decoding theora and vorbis, the codecs you would want
You CAN play theora video alone with it, but video AND audio, just doesnt work anyway near reliable... it will crap-out 8 out of 10 times...

Offline gouessej
« Reply #6 - Posted 2012-10-18 18:31:40 »

I remind you that JogAmp supports video playback.

Offline Cero
« Reply #7 - Posted 2012-10-18 19:51:43 »

I remind you that JogAmp supports video playback.

Ah yes I forgot, if you dont mind JOGL I would definitely check out JogAmp.

Offline gouessej
« Reply #8 - Posted 2012-10-18 20:00:49 »

I remind you that JogAmp supports video playback.

Ah yes I forgot, if you dont mind JOGL I would definitely check out JogAmp.
This is in this package, it relies on LibAV and FFMPEG as far as I know. It works fine even under Android  Grin

Offline theagentd

« JGO Bitwise Duke »


Medals: 361
Projects: 2
Exp: 8 years



« Reply #9 - Posted 2012-10-19 00:39:59 »

I remind you that JogAmp supports video playback.

Ah yes I forgot, if you dont mind JOGL I would definitely check out JogAmp.
This is in this package, it relies on LibAV and FFMPEG as far as I know. It works fine even under Android  Grin
Oh, neat!

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #10 - Posted 2012-10-19 08:53:04 »

This is in this package, it relies on LibAV and FFMPEG as far as I know.

Presumably LibAV or FFMPEG?!  Wink

From looking at the code it seems that this doesn't yet support audio playback?  It's also not bundling the libs, though I assume that's fairly easy to set up - JavaDoc mentions system install?

At the moment this would seem to be offering less than either the YUNPM or GStreamer-Java solutions.  I'm not keen on solutions tied to a particular output either.  Direct access to the native video buffers is far more useful across the board.  The GPU based YUV conversion is good, but it would still be possible to achieve this using direct buffer access.

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

« JGO Spiffy Duke »


Medals: 425
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #11 - Posted 2012-10-19 09:43:39 »

Don't underestimate YUV conversion on the GPU! It makes a massive difference to performance. Mind you, if you reach your target frame rate on your target hardware, who cares.

Cas Smiley

Offline nsigma
« Reply #12 - Posted 2012-10-19 09:48:23 »

Don't underestimate YUV conversion on the GPU! It makes a massive difference to performance. Mind you, if you reach your target frame rate on your target hardware, who cares.

I wasn't!  I'm saying you don't need to hard link the media player library to the OpenGL library to achieve it.

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

« JGO Spiffy Duke »


Medals: 425
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #13 - Posted 2012-10-19 09:49:57 »

Ah right.

Cas Smiley

Offline gouessej
« Reply #14 - Posted 2012-10-19 13:44:39 »

Presumably LibAV or FFMPEG?!  Wink
Sven could answer better than me.

From looking at the code it seems that this doesn't yet support audio playback?  It's also not bundling the libs, though I assume that's fairly easy to set up - JavaDoc mentions system install?
It's wrong. Sven made a demo of it as Siggraph 2012 with an extract of a famous movie and the audio playback worked just fine Smiley I'm really sorry for the lack of documentation. You can run our demos to check it out.

At the moment this would seem to be offering less than either the YUNPM or GStreamer-Java solutions.  I'm not keen on solutions tied to a particular output either.  Direct access to the native video buffers is far more useful across the board.  The GPU based YUV conversion is good, but it would still be possible to achieve this using direct buffer access.
It works out-of-the-box even on a Raspberry Pi and nobody prevents you from porting the code to LWJGL.

Offline nsigma
« Reply #15 - Posted 2012-10-19 14:23:55 »

It's wrong. Sven made a demo of it as Siggraph 2012 with an extract of a famous movie and the audio playback worked just fine Smiley I'm really sorry for the lack of documentation. You can run our demos to check it out.

I haven't tried the demos, so sorry if this does work.  I was going off the FFMPEG code in the JOGL repo which has the audio code commented out and a big "TODO: audio output"!  Wink

nobody prevents you from porting the code to LWJGL.

That misses my point, and assumes my only interest is getting video into LWJGL.  A useful video library will provide direct access to the video data through a native buffer or alternative pointer.  That data can then be used however you want, which may not involve OpenGL at all!

Given that I've got GStreamer code that works fine cross-platform, and offers far more than libAV, I don't have much interest in this myself!  However, as a lightweight option it could offer some benefits over the YUNPM approach by linking in-process rather than externally (particularly for seeking / syncing), if at the same time bringing up licensing issues.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Pages: [1]
  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.

PocketCrafter7 (14 views)
2014-11-28 16:25:35

PocketCrafter7 (10 views)
2014-11-28 16:25:09

PocketCrafter7 (11 views)
2014-11-28 16:24:29

toopeicgaming1999 (76 views)
2014-11-26 15:22:04

toopeicgaming1999 (67 views)
2014-11-26 15:20:36

toopeicgaming1999 (17 views)
2014-11-26 15:20:08

SHC (30 views)
2014-11-25 12:00:59

SHC (28 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (28 views)
2014-11-24 19:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!