I know from this Oracle blog entry (https://blogs.oracle.com/javafx/entry/mpeg_4_multimedia_support_in) that JavaFX can playpack "digital media stored in the MPEG-4 multimedia container format containing H.264/AVC video".
I also know that "versions of Windows older than Windows 7, readily available third party packages (such as this one) must be acquired and installed on the system."
I tried installing the demo version of the linked third party package from the mainconcept.com site http://www.mainconcept.com/products/apps-plug-ins/decoding/decoder-packs/h264avc-pro.html but the installer crashed and would not install.
So I instead installed installed and tested in turn, vlc 2.0.1, klite code pack 8.6.0, quicktime 7
http://www.videolan.org/vlc/
http://www.filehippo.com/download_klite_codec_pack/
http://www.apple.com/quicktime/download/
and after each install I was still unable to get a mp4 h264 video to play on Windows XP.
The test video I am trying to play is:
http://www.w3schools.com/html5/movie.mp4
Sample Program:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.media.*;
import javafx.stage.Stage;
public class MP4Player extends Application {
public static void main(String[] args) { Application.launch(args); }
@Override public void start(Stage stage) {
final MediaPlayer mediaPlayer = new MediaPlayer(new Media("http://www.w3schools.com/html5/movie.mp4"));
mediaPlayer.setAutoPlay(true);
mediaPlayer.setOnError(new Runnable() {
@Override public void run() {
System.out.println("Error: " + mediaPlayer.getError());
}
});
Scene scene = new Scene(new Group(new MediaView(mediaPlayer)), 320, 240);
stage.setScene(scene);
stage.show();
}
}
Sample output:
Error: MediaException: MEDIA_UNSUPPORTED : [com.sun.media.jfxmediaimpl.NativeMediaPlayer@38230] "Error H.264/AVC decoder is not available": "Error H.264/AVC decoder is not available"
Error: MediaException: MEDIA_UNSUPPORTED : [com.sun.media.jfxmediaimpl.NativeMediaPlayer@38230] "Error H.264/AVC decoder is not available": "Error H.264/AVC decoder is not available"
I also know that "versions of Windows older than Windows 7, readily available third party packages (such as this one) must be acquired and installed on the system."
I tried installing the demo version of the linked third party package from the mainconcept.com site http://www.mainconcept.com/products/apps-plug-ins/decoding/decoder-packs/h264avc-pro.html but the installer crashed and would not install.
So I instead installed installed and tested in turn, vlc 2.0.1, klite code pack 8.6.0, quicktime 7
http://www.videolan.org/vlc/
http://www.filehippo.com/download_klite_codec_pack/
http://www.apple.com/quicktime/download/
and after each install I was still unable to get a mp4 h264 video to play on Windows XP.
The test video I am trying to play is:
http://www.w3schools.com/html5/movie.mp4
Sample Program:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.media.*;
import javafx.stage.Stage;
public class MP4Player extends Application {
public static void main(String[] args) { Application.launch(args); }
@Override public void start(Stage stage) {
final MediaPlayer mediaPlayer = new MediaPlayer(new Media("http://www.w3schools.com/html5/movie.mp4"));
mediaPlayer.setAutoPlay(true);
mediaPlayer.setOnError(new Runnable() {
@Override public void run() {
System.out.println("Error: " + mediaPlayer.getError());
}
});
Scene scene = new Scene(new Group(new MediaView(mediaPlayer)), 320, 240);
stage.setScene(scene);
stage.show();
}
}
Sample output:
Error: MediaException: MEDIA_UNSUPPORTED : [com.sun.media.jfxmediaimpl.NativeMediaPlayer@38230] "Error H.264/AVC decoder is not available": "Error H.264/AVC decoder is not available"
Error: MediaException: MEDIA_UNSUPPORTED : [com.sun.media.jfxmediaimpl.NativeMediaPlayer@38230] "Error H.264/AVC decoder is not available": "Error H.264/AVC decoder is not available"