JME-JFX Problem

Hello everyone,
I just downloaded and installed JME-JFX, because I’d like to prerender my intro in Blender and then show it in JME.
The example class from github works fine with the movie from oracle, but if I have the exact same code in an AppState, I only get flashy blue/black change that hurts my eyes.:chimpanzee_sad:
Here is my class:

package Main.GameStates;

import Gui.Cinematics.SubtitleEvent;
import com.jme3.animation.LoopMode;
import com.jme3.cinematic.Cinematic;
import com.jme3.cinematic.MotionPath;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.CameraNode;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Quad;
import com.sun.javafx.application.PlatformImpl;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.embed.swing.JFXPanel;
import static;

 * @author Robbi Blechdose
public class IntroState extends GenericState implements ActionListener, CinematicEventListener
    private Cinematic introCinematic;
    private Node introScene;
    private CameraNode camNode;
    //Motion events
    private MotionEvent camMovement;
    private MotionPath camPath;
    private SubtitleEvent subtitle_1;
    private SubtitleEvent subtitle_2;
    private SubtitleEvent subtitle_3;
    private SubtitleEvent subtitle_4;
    private SubtitleEvent subtitle_5;
    private SubtitleEvent subtitle_6;
    private SubtitleEvent subtitle_7;
    private SubtitleEvent subtitle_8;
    private Geometry screenPlane;
    private Media media;
    private MediaPlayer mp;
    private TextureMovie tex;
    public IntroState()
        JFXPanel p = new JFXPanel();
    public void init()
        introScene = (Node) assetManager.loadModel("Scenes/Intro.j3o");
        //Init movie
        this.screenPlane = (Geometry) ((Node)((Node)introScene.getChild("TV")).getChild("Cube")).getChild("Screen");
        media = new Media(""); //"file:///link/to/movie.mp4");
        mp = new MediaPlayer(media);
        mp.setVolume(0.5 * setVars.SOUND_VOLUME);;
        tex = new TextureMovie(this.program, mp, LetterboxMode.VALID_LETTERBOX);
//        this.tex.setLetterboxColor(ColorRGBA.Black);
        Material mat = new Material(this.assetManager, "com/jme3x/jfx/media/MovieShader.j3md");
    mat.setTexture("ColorMap", tex.getTexture());
        introCinematic = new Cinematic(introScene, 35); //Adjust length as needed
    inputManager.addMapping("Skip", new KeyTrigger(KeyInput.KEY_SPACE), new KeyTrigger(KeyInput.KEY_RETURN));
    inputManager.addListener(this, "Skip");
    private void initCinematicEvents()
        camNode = introCinematic.bindCamera("cam", camera);
        camNode.setLocalTranslation(new Vector3f(0, 0, 10));
        camNode.lookAt(Vector3f.ZERO, new Vector3f(0, 0, 0));
        introCinematic.activateCamera(0, "cam");
        camPath = new MotionPath();
        camPath.addWayPoint(new Vector3f(0, 0, 10));
        camPath.addWayPoint(new Vector3f(0, 0, 3));
        camMovement = new MotionEvent(camNode, camPath);
        introCinematic.addCinematicEvent(0, camMovement);
    private void initSubtitles()
        subtitle_1 = new SubtitleEvent(guis.getNifty(), 3, "This is the planet Dasi. It is inhabited by robots.");
        introCinematic.addCinematicEvent(0, subtitle_1);
        subtitle_2 = new SubtitleEvent(guis.getNifty(), 3, "Once, they built spaceships and travelled to earth. They saw the steaming machines and locomotives.");
        introCinematic.addCinematicEvent(3, subtitle_2);
        subtitle_3 = new SubtitleEvent(guis.getNifty(), 3, "They liked it very much, and from then on, built everything in a style they called 'Steampunk'.");
        introCinematic.addCinematicEvent(6, subtitle_3);
        subtitle_4 = new SubtitleEvent(guis.getNifty(), 3, "To control everything important, they also built the CCM (Central Controlling Mechanism).");
        introCinematic.addCinematicEvent(9, subtitle_4);
        subtitle_5 = new SubtitleEvent(guis.getNifty(), 3, "");
        introCinematic.addCinematicEvent(12, subtitle_5);
        subtitle_6 = new SubtitleEvent(guis.getNifty(), 3, "But the machine is far too old now. It has started breaking apart.");
        introCinematic.addCinematicEvent(21, subtitle_6);
        subtitle_7 = new SubtitleEvent(guis.getNifty(), 3, "Its logic circuits failed, and the machine created a dictature.");
        introCinematic.addCinematicEvent(24, subtitle_7);
        subtitle_8 = new SubtitleEvent(guis.getNifty(), 3, "");
        introCinematic.addCinematicEvent(27, subtitle_8);
    public void onAction(String key, boolean isPressed, float tpf)
    if(key.equals("Skip") && !isPressed)

    public void onPlay(CinematicEvent cinematic)

    public void onPause(CinematicEvent cinematic)

    public void onStop(CinematicEvent cinematic)
        if(stateManager.getState(GameState.class) == null)
            stateManager.attach(new GameState(false));

Some help would be very nice. Also, the audio is playing and the screen stays black if I uncomment the letterbox color line.

try different codecs formats, javafx is unfortunatly extremly picky about what it supports.

handbrake,avidemux or ffmpeg might be helpfull tools

but I’m using the exact same file from the oracle URL. And in the demo file, it works, while it doesn’t in mine.

Ah ok, are you using the same version of jme?

Yes, I am.
I copied the file over into my project, so the lib configurations are 100% correct.

Hm ok :slight_smile:

My only guess then is some difference in live-cycle between your application and the test application, I fear that this will be kinda hard to debug.

So there isn’t any obvious cause?
Hm… I guess I’ll have to switch back to the cinematics then, altough they don’t look half as good for me.
Or I’ll experiment a while before that…

I don’t understand, you copied which file ?
Copying .java doesn’t garanty your lib configurations to be 100% correct.

How do the app behave if you create a Main with only this AppState ?
Can you share a project that reproduce the issue

Well, I copied the .java test class from JME-JFX into my game project, and used as a main class, it worked out of the box.
My class where it’s supposed to be used is an AppState that is created by a SimpleApplication.