1
\$\begingroup\$

Video playback in jMonkeyEngine 3.0 seemed to be in limbo for quite a while until I chanced upon this thread about playing videos by integrating JavaFX 2 into the JME3 framework. This coupled with the recent announcement of MP4 playback support in JavaFX made JME3 a real contender for a project I'm currently working on.

I followed the prescribed method as mentioned in the former thread, got the sources from the JME3-JFX project page and setup the project in eclipse. When I ran the example [TestMovie.java] with the given URL from Oracle, it ran smoothly with no issues. However when I attempted to play an MP4 file, it played for a brief period with messed up colours and then exited with a java.lang.IllegalArgumentException exception.

Here is the eclipse console output :

INFO: Audio effect extension version: 1.0
Nov 27, 2014 6:33:13 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 4
Nov 27, 2014 6:33:34 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalArgumentException: Number of remaining buffer elements is 6627840, must    be at least 14745600. Because at most 14745600 elements can be returned, a buffer with at least 14745600 elements is required, regardless of actual returned element count
at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162)
at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189)
at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:230)
at org.lwjgl.opengl.GL11.glTexImage2D(GL11.java:2845)
at com.jme3.renderer.lwjgl.TextureUtil.uploadTexture(TextureUtil.java:352)
at com.jme3.renderer.lwjgl.LwjglRenderer.updateTexImageData(LwjglRenderer.java:1913)
at com.jme3.renderer.lwjgl.LwjglRenderer.setTexture(LwjglRenderer.java:1936)
at com.jme3.material.MatParamTexture.apply(MatParamTexture.java:86)
at com.jme3.material.Material.render(Material.java:1088)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:523)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:322)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:374)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:763)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:719)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:983)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:745)

Now I'd like to clarify that the same MP4 file played flawlessly in a vanilla JavaFX project. Also, one of the developers has confirmed in the first mentioned thread on the jMonkeyEngine forums that he was able to play MP4 videos flawlessly and three of them simultaneously nonetheless. I'm testing these samples on Java 1.8 u25 on Windows 8.1 Pro [x86-64] running an Intel Core i5 [Haswell] with Intel HD 5000 graphics.

I'm a beginner to graphics development and am aware that the jMonkeyEngine forums are the best place to ask my question but their forum's Q/A section seems to be broken and I'm unable to post there. Any and all help will be appreciated.

\$\endgroup\$
1
\$\begingroup\$

This was bug. Reported it and it has hence been fixed.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.