JMF CannotRealizeException when reading mov files

78 views Asked by At

The below code is a simple wrapper for the JMF player. After trawling through countless fruitless google searches, I come here to ask why this code results in the error down below.

Goal: Be able to embed and play a .mov file into a JFrame

Purpose: Play a cutscene in a game with minimal external libaries
    public class Video {
        Player player;
    
        public Video(String filepath, JFrame f) {
            MediaLocator mediapath = new MediaLocator("file:///" + "./src/main/resources/" + "video.mov");
            try {
                this.player = Manager.createRealizedPlayer(mediapath);
                f.add(this.player.getVisualComponent()); // pull out the video component, add it to the jframe
            } catch (Exception e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    
        public void play() {
            this.player.start();
        }
    }
 Unable to handle format: mp4a, 1000.0 Hz, 16-bit, Stereo, BigEndian, Signed, FrameSize=32 bits
 Unable to handle format: AVC1, 640x640, FrameRate=30.0, Length=59353
Failed to realize: com.sun.media.PlaybackEngine@15d9bc04
Error: Unable to realize com.sun.media.PlaybackEngine@15d9bc04
javax.media.CannotRealizeException
    at javax.media.Manager.blockingCall(Manager.java:2005)
    at javax.media.Manager.createRealizedPlayer(Manager.java:554)
    at <package>.Video.<init>(Video.java:19)
0

There are 0 answers