Lib/API for create small gif from video? - java

I want to create GIF from the existing Video. I have search for related question but I did not find any link which can help me. I was looking for any library or API that can help me to either create bitmaps from the video then again I will create GIF from that bitmap or directly create GIF from the video.
Is there any lib or API to capture sequence of bitmaps from the video?
please give me any link for the library or API that can help me to do this.

Take look on JMF (Java Media Framework). It will take you some time to learn basics. Then you will able to do this. I do not have a code sample with me now but as far as I remember you have to create player, then retrieve from it appropriate "control" that provides you access to frames.
Here is an example for start: http://khemsoi.blogspot.com/2006/03/jmf-frame-grabber.html

Related

How to add a watermark to the saved video with CameraX api in saving time

I am using the CameraX api approach to record the videos and saving them as explained in the documents: https://developer.android.com/training/camerax/video-capture
I tried with ffmpeg-android-java but clearly it needs to process the saved video not adding to the saved frames in real time.
Now, I want to add a watermark to all saved videos in easy and not costly way and without the need to reprocess the video?
Also, if there is no way, what the best and fastest approach to process the video to only add a watermark?
My suggestion is that you need to write a player-like code that uses opengles to draw videos so you can add your own arbitrary watermark. Or use the cross-compiled ffmepg dynamic library (or static library) to add your own filters.
I shared an example of cross-compiled ffmpeg on github. Is to implement a player that can play video. Check it out here.
I hope you got some help.

show live video in a web application

I wish to show live video in a java-web application. For this I found that xuggler(java library) is capable of doing that. But I didn't get code to how to implement it.
I have done some tutorials with xuggler like capturing frames from a video. But not much familiar with xuggler. Please help.
Any help is appreciated.

Running ffplay video within a jframe

I wish to play a video in JFrame. I am already using ffmpeg in my project. As I wish to keep the project light, I am not willing to use other frameworks like JMF or other. I know that I can play video using ffplay. But the problem here is ffplay opens the video in new window when I try
ffplay output.avi
I wish to put that video within my JFrame, like a player. How can I do this?
Request:
Please ask for any other clarifications, details, and suggest improvements or comment what you find wrong before downvoting or voting to close the question:). I will change it. I am really new to Java, I tried searching this but could not find any possible solution.
What I tried? I couln't find anything related to this, so I don't have any code. I am familiar to how to create frames, and can use runtime to ffplay video. But I got no clue how to put that video within my window:(.
All suggestions are welcome if you can suggest me other methods to play the video. But I haven't use any frameworks other than ffmpeg. And do not wish to make the application heavier. So it would be more helpful if it can be achieved using ffplay.
Look at the JMF 2.1.1 - Supported Formats. If the video types you wish to support are covered by the cross-platform1 version of the JMF, or you can find an SPI for the format, I'd say use JMF.
The 'performance pack' version uses natives which are now very old. I would not recommend trying to use them.

Library that can extract and play video file

I will build a simple program that
Can play video file (.mp4) in my program.
Can extract the video, so that I can get the title, length, subtitle, and the audio, etc.
What is the library in Java that I should use?
I have googled, but I still can not find the best library. By the way, I have tried to download xuggler, but I can not find any file.exe that can install this library.
Please be kind because I never make a code regarding video player and video extractor.
For playing audio and video in your java program use Java Media Framework. It contains jar files that will provide you classes to play and handle audio and video files.
Use this tutorial for understanding of JMF.
I have successed to use xuggler in java. Xuggler website is suck because they don't keep good installer in their website. Every beginner who use xuggler must be have some trouble like me.
For every one who want to use Xuggler, you can follow this website
http://www.benfarahmand.com/2012/11/tutorial-using-xuggler-in-processing.html
the link to download file.exe xuggler is here: https://www.dropbox.com/s/oh7zcyilibzfoyb/xuggle-xuggler.5.1.0-win64-setup.exe
Thank you :)

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