How to play other video formats in JavaFX - java

I am busy with a movie/video-clip player/library.
I want to do this in JavafX. Almost 90% of the video clips is in AVI format. I cannot for several reasons covert the movies/video-clips.
I also want the program to mark the video files that were played, from start to complete, so that I will know what have been watched. So the program needs to be able to interact with the video player to know when the video has played to the end.
JavafX doesn't allow playback for AVI files. What's the alternative to be able to use this with? And how will I know if the video has fully played from beginning to end.
I read the following
Adding other video codecs / DVD support to JavaFX 2.2
Where they suggest I use portable VLC player. Is this the best way to use it in JavafX and if possible does the API have register hooks to register a method that can be triggered to know when the video has stopped?

Related

How to separate audio from video without converting into a file?

googled and found some libraries like xuggle, vlcj and how to convert video to audio. But I want to stream audio without making it as a separate audio file using java. Please help.
It might be possible to use vlcj for it even though it feels like a strange way to go since it's a library created for video playback.. but if you just don't set a video surface then it might play only the audio.. not sure if it's possible through the embeddedmediaplayercomponent but it should be possible if using the DirectMediaPlayerComponent.

Android and ffmpeg. Play video (with sound)

I have compiled ffmpeg library add it to my project and now I want to play video (with full list of options - stop, pause, forward, backward etc). I have read roman10 ffmpeg tutorial. And I also find out tutorial which describes how play video with ffmpeg and SDL framework. The difference (if I have correctly understood) is that in roman's tutorial each frame of video turns into a Bitmap and is then passed to Java code where it shows on SurfaceView. And in the second tutorial, the video is playing with the help of the SDL framework without passing it back to Java code.
I want to ask some questions:
Which way is better: return Bitmap back to Java and show it on SurfaceView or play it with SDL?
How can I play the sound of my video (can I do it with ffmpeg or do I need some additional libraries)?
this might help you
https://github.com/vanevery/JavaCV-0.5-Stream-Test
https://github.com/vanevery/JavaCV_0.3_stream_test
It's a player based on ffmpeg streaming.

GIF Speed based per computer?

I'm working on a game engine, and want the option to play video to a jpanel or whatever. I've been trying to figure out HOW to do this, preferably using mp4, WITHOUT USING ANY 3RD PARTY SOFTWARE. The only option i've come to is using a combined gif and .wav series.
My question is, does a .gif play faster per computer? for example, if i get the movie synced perfectly on my desktop, would it have the odds of not being in sync with my laptop? would the .gif play slower/faster? If the answer is yes, how in the heck would i fix this?
Thanks!
Since you are building the video in a .gif then you should be able to just take the individual images and paint them at the desired frame rate in your application without using 3rd party software.
This would allow you to sync it with your .wav for sound.

How to play video and audio from a video file in Java

I understand this question has been asked many times before, but after searching all of the answers seem to be outdated (by two or more years) so I thought it reasonable to ask it again.
What libraries are available to read and display video files (such as .avi and similar) in java? I am currently using lwjgl, and cannot easily change to a different library, so please limit suggestions to those compatible with lwjgl.
What I'm trying to do is create a fullscreen display using lwjgl, display the video (with audio synced) as an intro, then either when the video is finished or forcefully skipped continue to the main menu.

Converting audio files(.3gp) to video with Album cover and uploading to YouTube

I have an audio file in .3gp format on my Android device which I wish
to upload to YouTube. I know that YouTube is a video upload site and
that I need to convert this sound file to video.
I just want an image to display all the time the audio is playing.
Google tells me there are number of tools that can help me. But I want
to do this via java code from my Android device.
Please help.
Thanks.
There are tools such as FFMPEG available for free that allow you to, essentially, mix and convert heterogenous streams. That is you can add a bitmap to a video, create video from slide shows and then add sound etc. (See a related question I asked here).
These programs can be executed from within java applications by making Runtime.exec(..) calls.
Sun has an example for stitching multiple JPEGs together into a movie, you can find it here. You should be able to take this example, (its fairly robust), and add what you need to it.
I recommend looking into the Java Media Framework (FAQ)
You can find a vast collection of sample applets/code at the Sun Solutions page. You can find the API on this page. I do hope this is compatible on the Android platform, as I haven't had any personal experience developing for it. But it might be a good place to start.

Categories