there is any way to play mp4 video file in glfw window?
any example anything?
LWJGL doesn't have bindings to ffmpeg or libvlc, but there are third party bindings available. I haven't tried them, so not sure how well maintained they are or how easily they can be integrated with GLFW/OpenGL.
maybe any other video format
The way to do it with out bindings is to call the ffmpeg executable from java with the command line arguments of choice then use the input stream to generate byte buffer texture data that you can then use to update an FBO regularly.
I have done this but I also have a theora decoder I am working on which is written is pure java which skips the ffmpeg stage and just generates byte buffer data textures. The decoder is about 90% done, the spec isn't that good and I haven't worked out where my issues are so I have given up for the moment. It plays videos but there are issues with the movement vectors.
ant how do you synchronized the frame rate and the audio?
can you show me example when you done?
Its probably easier to show you this which does things in a similar way I think (my code is too integrated in to the engine I have to easily see what it is doing)
http://www.java-gaming.org/topics/java-media-player/27100/view.html
Audio Sync : I use openal and it does the syncing for you, you just need to feed it data at a faster rate than it can consume
Video sync : you know the frame rate so you time each draw cycle to decide if you need to skip a frame or if you need to wait a bit longer
this is liby is too old not working whit glfw3 and lwjgl3
You are correct but it shows you a way to do it, you can build something similar yourself
what decoder you use for mp4?
how can I decoder audio form mp4 file?