Generate video with ffmpeg to play using JavaFX <p>People always say to post a new question so I am posting a new question that relates to <a href="http://stackoverflow.com/questions/27354320/generate-video-with-ffmpeg-for-javafx-mediaplayer">Generate video with ffmpeg for JavaFX MediaPlayer</a></p> <p>The images I use can be downloaded from here <a href="https://www.dropbox.com/s/mt8yblhfif113sy/temp.zip?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/mt8yblhfif113sy/temp.zip?dl=0</a>. It is a 2.2GB zip file with 18k images, still uploading, might take some time. The images are slices of a 3D object. I need to display images every 10ms to 20ms. I tried it with Java, but just couldn't get faster than 30ms+ so now I am trying to generate a video that will display images as fast as I want without worrying about memory or CPU power.</p> <p>People will be using my software to slice the objects and then generate the videos to be played later one. The player might run on a cheap laptop or might run on a Raspberry Pi. I need to make sure the slicer will work on any OS and that people don't need to install too much extra stuff to make it work. It would be best if I can just include everything that is needed in the download of the app.</p> <p>I also posted here <a href="https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=15&amp;t=2474&amp;sid=4f7a752f909202fbec19afc9edaf418c" rel="nofollow noreferrer">https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=15&amp;t=2474&amp;sid=4f7a752f909202fbec19afc9edaf418c</a></p> <p>I am using Windows 7 and I have VLC installed. The ffmpeg version is</p> <pre><code>ffmpeg version N-72276-gf99fed7 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (GCC) </code></pre> <p>I also tried the command lines posted on the linked question</p> <p>This line produced the video and JavaFX didn't have any errors</p> <pre><code>ffmpeg -f image2 -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -vcodec mpeg4 -qscale 1 -f mp4 Timelapse.mp4 </code></pre> <p><img src="https://i.stack.imgur.com/AXYW4.png" alt="enter image description here"></p> <p>This line also produced the video, but JavaFX had an error: "Caused by: MediaException: MEDIA_UNSUPPORTED : Unrecognized file signature!"</p> <pre><code>ffmpeg -f image2 -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1920x1080 -vcodec mpeg4 -qscale 1 Timelapse.avi </code></pre> <p><img src="https://i.stack.imgur.com/2Vmps.png" alt="enter image description here"></p> <p>I also tried this two pass encoding I believe. It produced the video, but didn't play</p> <pre><code>ffmpeg -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -r 50 -b:v 1550k -bt 1792k -vcodec libx264 -pass 1 -an combined50.flv &amp;&amp; ffmpeg -y -r 50 -i "Mandibular hollow 1 micron.gizmofill%d.gizmoslice.jpg" -s 1638x1004 -r 50 -b:v 1550k -bt 1792k -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ab 128k combined50.flv </code></pre> <p>This is my JavaFX code. As you can see I tried the Oracle video and that worked fine.</p> <pre><code>public class FXMLDocumentController implements Initializable { @FXML private Label label; @FXML private MediaView mediaView; @FXML private void handleButtonAction(ActionEvent event) { System.out.println("You clicked me!"); // final File f = new File("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv"); final File f = new File("C:/Users/kobus/Dropbox/JavaProjects/Gizmetor/temp/Timelapse.avi"); // "C:/Users/kobus/Dropbox/JavaProjects/Gizmetor/temp/combined50.avi.flv" // http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv Media media = new Media(f.toURI().toString()); // Media media = new Media("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv"); MediaPlayer mediaPlayer = new MediaPlayer(media); mediaPlayer.setAutoPlay(true); mediaPlayer.play(); mediaView.setMediaPlayer(mediaPlayer); label.setText("Hello World!"); System.out.println(mediaPlayer.isAutoPlay()); // mediaView } @Override public void initialize(URL url, ResourceBundle rb) { // TODO } } </code></pre>