Problem with playing video in jmonkey with JFJR/JMF/FOB

Hi…i'm a realy newbie in jmonkey…:smiley:



i'm starting a project to make a simple game…and i wanna add a movie as a opening in my game…



i've tried to play movie through tutorial from here…

http://www.jmonkeyengine.com/jmeforum/index.php?topic=2908.0



i had follow the instruction, but it still didn't work…





from TestJMFVideoImage.java i've got error message from this line:

tex.setImage(image)





and also in JMFVideoImage.java i've got error message too…

data = ByteBuffer.allocateDirect(sizessizes4).order(ByteOrder.nativeOrder());

with error

incompartible types

found java.nio.ByteBuffer

required: java.util.ArrayList<>"





the JFJR that llama make using JME1, and i use JME 2, so convert it according tutorial from http://www.jmonkeyengine.com/wiki/doku.php?id=jme_to_jme2_changes



also, when i tried to run this program, they got error meassage…


run:
Mar 7, 2009 9:16:44 AM com.jme.app.BaseGame start
INFO: Application started.
Mar 7, 2009 9:16:44 AM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
Mar 7, 2009 9:16:44 AM com.jme.system.PropertiesGameSettings load
INFO: Read properties
Mar 7, 2009 9:17:16 AM com.jme.system.PropertiesGameSettings save
INFO: Saved properties
Mar 7, 2009 9:17:16 AM com.jme.app.BaseSimpleGame initSystem
INFO: jME version 2.0 Stable (r4093)
Mar 7, 2009 9:17:16 AM com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
Mar 7, 2009 9:17:16 AM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:  640H: 480        Version: 2.0.1
Mar 7, 2009 9:17:17 AM com.jme.app.BaseSimpleGame initSystem
INFO: Running on: igxprd32
Driver version: 6.14.10.4906
Intel - Intel 945GM - 1.4.0 - Build 7.14.10.4906
Mar 7, 2009 9:17:17 AM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Mar 7, 2009 9:17:17 AM com.jme.util.lwjgl.LWJGLTimer <init>
INFO: Timer resolution: 1000 ticks per second
Mar 7, 2009 9:17:17 AM com.jme.scene.Node <init>
INFO: Node created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Node <init>
INFO: Node created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Node <init>
INFO: Node created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Node attachChild
INFO: Child (Graph node) attached to this node (Stats node)
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
WARNING: FBO not supported.
Mar 7, 2009 9:17:17 AM com.jme.system.lwjgl.LWJGLDisplaySystem createTextureRenderer
INFO: FBO not supported, attempting Pbuffer.
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer setMultipleTargets
INFO: Copy Texture Pbuffer supported!
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer <init>
INFO: Creating Pbuffer sized: 1024 x 512
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer initCamera
INFO: Init RTT camera
Mar 7, 2009 9:17:17 AM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Node <init>
INFO: Node created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Line <init>
INFO: Line created.
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer setupTexture
INFO: setup tex2: 1024,512
Mar 7, 2009 9:17:17 AM com.jme.scene.Node attachChild
INFO: Child (lineGraph) attached to this node (Graph node)
Mar 7, 2009 9:17:17 AM com.jme.scene.Node attachChild
INFO: Child (f4) attached to this node (Graph node)
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
WARNING: FBO not supported.
Mar 7, 2009 9:17:17 AM com.jme.system.lwjgl.LWJGLDisplaySystem createTextureRenderer
INFO: FBO not supported, attempting Pbuffer.
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer setMultipleTargets
INFO: Copy Texture Pbuffer supported!
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer <init>
INFO: Creating Pbuffer sized: 1024 x 128
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer initCamera
INFO: Init RTT camera
Mar 7, 2009 9:17:17 AM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Mar 7, 2009 9:17:17 AM com.jme.scene.Node <init>
INFO: Node created.
Mar 7, 2009 9:17:17 AM com.jme.renderer.lwjgl.LWJGLPbufferTextureRenderer setupTexture
INFO: setup tex3: 1024,128
Mar 7, 2009 9:17:17 AM com.jme.scene.Node attachChild
INFO: Child (labelGraph) attached to this node (Graph node)
Fobs4JMF - Native shared library found
5.07173First Position: 466, 34 Duration: 5071
Frame Rate: 29.97
Opening Thread[JMF thread: com.sun.media.PlaybackEngine@9ced8e[ com.sun.media.PlaybackEngine@9ced8e ] ( configureThread),9,system]
ByteBufferRenderer: setInputFormat
Format (RGB masks, pixelstride, linestride, bbp, flipped
ff0000
ff
ff00
1
352
32
false
set Size: 352 240
texture format: GL_UNSIGNED_INT_8_8_8_8_REV
FOBS found
Frame buffer size (bytes): 337920
ByteBufferRenderer: setInputFormat
Format (RGB masks, pixelstride, linestride, bbp, flipped
ff0000
ff
ff00
1
352
32
false
set Size: 352 240
FOBS found
Frame buffer size (bytes): 337920
Created player for: file:F:/kacau/ChiasaAonuma.MPG
Mar 7, 2009 9:17:18 AM com.jme.scene.Node attachChild
INFO: Child (quad) attached to this node (rootNode)
using flipped quad
Mar 7, 2009 9:17:18 AM class TestJMFVideoImage.TestJMFVideoImage start()
SEVERE: Exception in game loop
java.lang.NullPointerException
        at com.jme.scene.state.lwjgl.LWJGLTextureState.load(LWJGLTextureState.java:486)
        at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(LWJGLTextureState.java:881)
        at com.jme.renderer.lwjgl.LWJGLRenderer.applyStates(LWJGLRenderer.java:1725)
        at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:961)
        at com.jme.scene.TriMesh.draw(TriMesh.java:240)
        at com.jme.scene.Spatial.onDraw(Spatial.java:428)
        at com.jme.scene.Node.draw(Node.java:520)
        at com.jme.scene.Spatial.onDraw(Spatial.java:428)
        at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:1202)
        at com.jme.app.SimpleGame.render(SimpleGame.java:81)
        at com.jme.app.BaseGame.start(BaseGame.java:87)
        at TestJMFVideoImage.TestJMFVideoImage.main(TestJMFVideoImage.java:142)
Mar 7, 2009 9:17:18 AM com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
Mar 7, 2009 9:17:18 AM com.jme.app.BaseGame start
INFO: Application ending.
BUILD SUCCESSFUL (total time: 34 seconds)


that anyone give an explanation..?

tengkyu, and sorry for my bad english..

it's running well when i run it in jme1…



but not in jme 2…  :cry:



can anyone give me the complete code of jfjr in jme2.0 version…??



thank you so much…






up-up…



if anyone can help me, i'm very glad…

up-up…





hello…



anybody home…??  :? :?

I'm home!

Unfortunately I have never used this and so can't be of much help  :frowning:

Alric said:

I'm home!
Unfortunately I have never used this and so can't be of much help  :(


i'm dead... :'( :'( :'(

i really-really need someone to pick me up from valley of the darkness...

hello…??



there's anybody home…??



wew…feels like living  in a cave in the northpole… :lol:



soooo quite…  :smiley: :smiley:

I don't have any experience with this either. The only changes you made were the ones needed to compile with jME 2, right? It will take some digging, then. I might be able to look at it this evening.

As it seems very few people have worked in this area, not many will have existing code to test with.



It might help greatly if you could post some code to show exactly what you are doing - that way it would be easier for someone to take a look at the problem. The time it would take to read through the threads and try and write something to look at this for you may be putting people off trying.


Yes, if you could post a simple test class along with a small video clip it would make it that much easier for us to give you a hand.

huaa…all of you makes me really2 happy…



my tears dropped through this happiness… :roll:



if you wanna see my complete code in jme2, (that frustated me   :’( ) here it is…



http://www.mediafire.com/file/iumoymbvnje/src.rar



all  angels smile to both of you…  :slight_smile:



muach-muach, tengkyu very much for your responses…

up-up

:roll:



up-up…

up-up…



:smiley:

Okay, that is getting to the point of spam.  Please allow at least 24 hours before bumping your posts…



ppl have seen your post (myself included) and while I did download your 'test' (Nymon asked for a simple test, not your whole project ;)); I have no experience with 'JFJR/JMF/FOB' (only a few ppl do). 



A lot of the issues you will encounter along your 'game development' journey will need to be solved by you; while ppl here are very willing to help we are all very busy and cannot invest very much time in solving problems for others when we have so many of our own…



Therefore, help us help you.  Limit your code to ONLY the specific problem at hand; create a simple test (based off of SimpleGame, just like the tests included in jME).  And show that you are trying to at least figure them out and not just waiting for a hand out.



(What you are trying to accomplish IMO should only be attempted by a person who already is very comfortable with jME…)

Well curiosity got the better of me, and it took me ages to get this set up but I have found the problem.



In JMFVideoImage you commented out a line :-



//data = ByteBuffer.allocateDirect(sizesize4).order(ByteOrder.nativeOrder());



But you didn't replace it with anything. This meant that the first frame it attempts to fetch will not be there, and you get the null pointer exception. In place of the line you removed add :-



data = new ArrayList<ByteBuffer>();

data.add(ByteBuffer.allocateDirect(sizesize4).order(ByteOrder.nativeOrder()));

         



<< JOC >>

Thanks JOC, I sat in front of this last night for about 20 minutes and decided I didn't have the patience to dig into this one. Someone should add this to the jME 2 code snippets page.

basixs said:

Okay, that is getting to the point of spam.  Please allow at least 24 hours before bumping your posts...

ppl have seen your post (myself included) and while I did download your 'test' (Nymon asked for a simple test, not your whole project ;)); I have no experience with 'JFJR/JMF/FOB' (only a few ppl do). 

A lot of the issues you will encounter along your 'game development' journey will need to be solved by you; while ppl here are very willing to help we are all very busy and cannot invest very much time in solving problems for others when we have so many of our own...

Therefore, help us help you.  Limit your code to ONLY the specific problem at hand; create a simple test (based off of SimpleGame, just like the tests included in jME).  And show that you are trying to at least figure them out and not just waiting for a hand out.

(What you are trying to accomplish IMO should only be attempted by a person who already is very comfortable with jME...)



ok..i'm sorry..i don't meant it..

but somehow i believe that many fresh newbie like me want to play movie in their game ..because IMO, ability to play movie in a game engine is really essential..:).

mmm..in my thread post i limited my problem only with my spesific problem, right..?




JOC said:

Well curiosity got the better of me, and it took me ages to get this set up but I have found the problem.

In JMFVideoImage you commented out a line :-

//data = ByteBuffer.allocateDirect(size*size*4).order(ByteOrder.nativeOrder());

But you didn't replace it with anything. This meant that the first frame it attempts to fetch will not be there, and you get the null pointer exception. In place of the line you removed add :-

data = new ArrayList<ByteBuffer>();
data.add(ByteBuffer.allocateDirect(size*size*4).order(ByteOrder.nativeOrder()));
           

<< JOC >>


thankyou JOC..

oh, i'm sorry, i forgot to erase the comment in front that line..yes you right, that line is the main problem.

huff..

tengkyu, i'll try it...

ok thankyou so much..



nymon said:

Thanks JOC, I sat in front of this last night for about 20 minutes and decided I didn't have the patience to dig into this one. Someone should add this to the jME 2 code snippets page.


20 minutes..?

i've spend more than one week to dig it...

whew…it's works… :smiley:



i'm was focused on the error of lwjgl format in the Texture.java…cause it said error lwjgl rendering…



i have to really2 hard to learn… :lol:



tengkyu very much…


I also spent 30 minutes to try and help you (but my, and many others, priorty is to their jobs/income)  therefore I couldn't give you any more time than that.



Good catch JOC, didn't even see that