Search code examples
javajavafxmovie

JavaFX text overlay and export overlayed movie


I am trying to write a simple karaoke maker application by using JavaFX that comes with the latest version of Oracle JDK8. I can simply put a movie with mp4 extension and JavaFX Text together on a scene by putting MediaView and Text objects into a Group and added the group to Scene object which works fine.

My question is how to export the final output in mp4 format. The output should have the movie with time-based animated text as it is seen on the scene in the application. The movie I used here is already in mp4 format.

Thank you.


Solution

  • You can't create mp4 files with JavaFX out of the box, i. e. without 3rd party products.

    Only because the movie is already in mp4 format doesn't mean you can just overlay something on it and keep the mp4 file as it is. You'd have to re-encode the movie with the overlaid content.