[SOLVED] Jme3 Beginner: Creating a video for the animation

I am trying to create a video for my animation using: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:intermediate:screen_capture?s[]=record



So after completing the tutorial step by step, I think I am missing something as I am getting the following error:



[java]

11:28:01,318 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]

11:28:01,318 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Program%20Files%20(x86)/Xuggle/share/java/jars/xuggle-xuggler-test.jar!/logback.xml]

11:28:01,374 |-WARN in ch.qos.logback.core.joran.event.SaxEventRecorder@8c436b - Parsing warning on line 1 and column 0 org.xml.sax.SAXParseException: URI was not reported to parser for entity [document]

at org.xml.sax.SAXParseException: URI was not reported to parser for entity [document]

at at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934)

at at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631)

at at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358)

at at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159)

at at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)

at at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)

at at javax.xml.parsers.SAXParser.parse(Unknown Source)

at at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:67)

at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)

at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:75)

at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:39)

at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:47)

at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:108)

at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)

at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:56)

at at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)

at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)

at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)

at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)

at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)

at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)

at at com.xuggle.ferry.JNIMemoryManager.<init>(JNIMemoryManager.java:861)

at at com.xuggle.ferry.JNIMemoryManager.<clinit>(JNIMemoryManager.java:860)

at at com.xuggle.mediatool.MediaWriter.<clinit>(MediaWriter.java:119)

at at com.xuggle.mediatool.ToolFactory.makeWriter(ToolFactory.java:149)

at at com.kiva.sim.animation.Video.VideoProcessor.preFrame(VideoProcessor.java:95)

at at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1099)

at at com.jme3.renderer.RenderManager.render(RenderManager.java:1167)

at at com.jme3.app.SimpleApplication.update(SimpleApplication.java:263)

at at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)

at at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at at java.lang.Thread.run(Unknown Source)

11:28:01,395 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set

11:28:01,395 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]

11:28:01,402 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]

11:28:01,464 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [CONSOLE] from the object stack

11:28:01,464 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]

11:28:01,465 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]

11:28:01,471 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [test.log]

11:28:01,473 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [FILE] from the object stack

11:28:01,473 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to DEBUG

11:28:01,473 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[root]

11:28:01,474 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[root]



2011-11-10 11:28:01,506 [LWJGL Renderer Thread] ERROR com.xuggle.ferry.JNILibraryLoader - Could not load library: xuggle-ferry; version: 3; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem

Nov 10, 2011 11:28:01 AM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.UnsatisfiedLinkError: no xuggle-ferry in java.library.path

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)

at java.lang.System.loadLibrary(Unknown Source)

at com.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:265)

at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:168)

at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:14)

at com.xuggle.ferry.JNIMemoryManager.<clinit>(JNIMemoryManager.java:871)

at com.xuggle.mediatool.MediaWriter.<clinit>(MediaWriter.java:119)

at com.xuggle.mediatool.ToolFactory.makeWriter(ToolFactory.java:149)

at com.kiva.sim.animation.Video.VideoProcessor.preFrame(VideoProcessor.java:95)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1099)

at com.jme3.renderer.RenderManager.render(RenderManager.java:1167)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:263)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Unknown Source)

Nov 10, 2011 11:28:01 AM com.jme3.renderer.lwjgl.LwjglRenderer cleanup

INFO: Deleting objects and invalidating state

Nov 10, 2011 11:28:01 AM com.jme3.input.lwjgl.LwjglMouseInput destroy

INFO: Mouse destroyed.

Nov 10, 2011 11:28:01 AM com.jme3.input.lwjgl.LwjglKeyInput destroy

INFO: Keyboard destroyed.

Nov 10, 2011 11:28:01 AM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread

INFO: Display destroyed.

[/java]



The steps I took were:



1- install xuggler and import all its jar files to my project

2- create ISOTimer.java

3- create VideoProcessor.java

4- add the timer getter and setters functions to my main (IS THIS CORRECT OR SHOULD I ADD THEM SOMEWHERE ELSE) and also call the following from my main:



[java]

try{ // set the timer to 30fps lock-step

this.setTimer(new IsoTimer(30));

this.viewPort.addProcessor(new VideoProcessor(myVideoFile).setFps(30));

}

catch (IOException e)

{

e.printStackTrace();

}

[/java]

No one will answer you…

They don’t know the answer.

@jinjie is right, we have to care for a troll infection and cannot answer so fast :roll:.



You have to put the binary of xuggler (.dll, .so, .jnilib, depending on your OS) into the directory where you execute the application (so your project root folder when you run inside the IDE and the dist/ folder when you run the jar. This is the issue: “java.lang.UnsatisfiedLinkError: no xuggle-ferry in java.library.path”

2 Likes

Thanks normen, I added it to my class path and added the bin folder too.



now I have a different one:



[java]Nov 10, 2011 12:54:59 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalArgumentException: could not open: C:UsersgarnaoutDesktopAccurev_workspaceJSLDriveModelVideohelloVideo.flv

at com.xuggle.mediatool.MediaWriter.open(MediaWriter.java:1289)

at com.xuggle.mediatool.MediaWriter.establishStream(MediaWriter.java:627)

at com.xuggle.mediatool.MediaWriter.addVideoStream(MediaWriter.java:496)

at com.xuggle.mediatool.MediaWriter.addVideoStream(MediaWriter.java:416)

at com.kiva.sim.animation.Video.VideoProcessor.preFrame(VideoProcessor.java:96)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1099)

at com.jme3.renderer.RenderManager.render(RenderManager.java:1167)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:263)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Unknown Source)

Nov 10, 2011 12:54:59 PM com.jme3.renderer.lwjgl.LwjglRenderer cleanup

INFO: Deleting objects and invalidating state

Nov 10, 2011 12:54:59 PM com.jme3.input.lwjgl.LwjglMouseInput destroy

INFO: Mouse destroyed.

Nov 10, 2011 12:54:59 PM com.jme3.input.lwjgl.LwjglKeyInput destroy

INFO: Keyboard destroyed.

Nov 10, 2011 12:54:59 PM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread

INFO: Display destroyed.

[/java]



PS: what’s with you negative points? you’re like the fastest replier on this forum!!

I posted an update in my profile about that :wink: http://hub.jmonkeyengine.org/members/normen/

Edit: About the error: Looks funny, make sure the folders exist and and you don’t have user issues.

It works now… I should have restarted after setting the path (works on JMP) - should work on Eclipse so ill try it.



However even with setting the FPS to this.setTimer(new IsoTimer(50))



The video is still running at 30 fps, I tried the basic helloVideo example so nothing special. Why is the frame rate low?

and congrats for ur points back :wink:

Its fixed at the video framerate. Theres no use for frame rates above 30fps really, a cinema movie has 25fps.

Its fixed at the video framerate
isn't the the function in question? I changed it back to 30, you're right, no difference. I am not sure if it's me or not but it really looks to me that the rotation of that cube is breaking up.

Afaik the whole code is fixed at 30fps, so using anything else will result in issues (e.g. sound etc)

1 Like

Normen, how hard would it be to be able to create some function that allows me to skip to a certain time frame?



Any idea how would I go to implement it?





I thought of 2 options:



(1) be able to skip the created video itself to say time 30 and then start recording.



(2) Since I am using cinematics, find a way to skip the file to time 30 and that way I don’t have to touch the video.

Problem is to “skip” you have to compute everything in between (e.g. physics results etc. have to be computed). Setting the speed would allow you to “cue forward”. But I think its easier to just record everything and then edit the video.

But I think its easier to just record everything and then edit the video.

That's what I'm doing for now, but it's not the right way as I want eventually my animation program to have that feature.


Setting the speed until reaching that specific time is the easier approach, however, I had in mind a feature of being able to skip directly to let's say time 20,000 (which would not b very efficient if I speed up the animation till reaching that time). Having the ability of jumping directly to that time would be great but can't think of how I would be able to implement it.

Thats because of the problem I outlined ^^ You’d have to create a “timeless” version of every subsystem. E.g. one that tells you “what would be that animation at 2:00”, one that tells you “how would the physics objects be at 2:00”, one that tells you “what would the entity do after 2:00” etc etc. Its not really possible w/o just accelerating stuff. When you only use cinematics thats easier, you can simply set the time for the timeline. Else you only have the chance to play the scene once and while its playing track the objects and create a cinematic track for it (or store it else wise) for later playback.

1 Like

You can try calling Application.update(30) which would go forward in time for 30 seconds, many systems aren’t designed however to go through that much time and there could be failures … Use at your own risk

@Momoko_fan, can I add any number in the update? I tried app.update(30) nothing happened , also tried cinematic.update(30) nothing…



Or is it the application state that I must trigger? cz I don’t have a single app state that contains all my calculations



could you explain this function more?



thanks

I guess it won’t work that way … You have to look inside what Application.update() does and try to change the TPF value to whatever you need to fast forward by …

@momoko_Fan what do you mean by look inside what Application.update() does?

Discussion continued on: http://hub.jmonkeyengine.org/groups/general-2/forum/topic/jme3-beginner-jumpingskipping-animation-to-a-certain-time-event/



as this is becoming out of topic (and to avoid cross-topic replies)