java framework for manipulate audio and video - java

I'm searching a java framework for manipulate audio and video files, I need functions like:
Split video and audio files
Get a frame from a video
Key Frame extraction
I tried Xuggle and I want to know if there are other frameworks.
any advice?

I found Xuggler: http://www.xuggle.com/xuggler/

Which audio and video format you are dealing with? For MPEG-2, Project X may be a solution.

Related

Play m4a files in Java

I want to create a media player in Java. The mp3 support already works with the JLayer library but which library can play m4a files?
I read about vlcj here on stackoverflow, but this seems to depend on Swing/AWT which I wouldn't use because I want to port the application to Android later on.
Have you looked at JAAD? It's a Javasound SPI that decodes AAC audio, I've used it with success previously.
Note that m4a is a container format, and while it usually contains (in my experience) AAC audio, in theory it could contain other formats instead.
You can find some information about getting it working without Javasound (and a test case) here.
This answer is indirect. I don't really know anything about m4a files. But what I have found is an open source library that can stream them as a flash server named red5. It's written in Java so theoretically you should be able to browse their code to figure out how to do it.
Hopefully someone here can give a more direct answer, this is the best I can do.
If you have Java 7 or later, you have access to the Javafx library. You can also use your media player (like iTunes or Windows Media Player) to convert to the simpler mp3 version and run that. I wouldn't recommend .wav files as they have significantly more data usage than mp3s, (which condense the file size by compressing the .wav data and omitting inaudible and otherwise garbage-y data).
import javafx.scene.media.*;
String name = "song.mp3";
Media song = new Media(name);
MediaPlayer player = new MediaPlayer(song);
player.play();

Capturing Continuous Frames and merging them as one in java

I am pretty new to image capturing using java. Just started working in java.
What i want to ask is i have two flv videos i will like to combine. I searched the internet and many people said about xuggler.
I have a looked on it and did not found any documentation or tutorial regarding this.
I do have it that i will have to capture frames continuously and than
add each frame with each other as i want a picture in picture video
and than form the video from those frames.
Please can anyone help me out here , how to capture continuous frames from an flv file and join them so a new video output can be obtained. Any hint or tutorial will be great. Thank you. I am using adobe flash builder and red5.
If you need to tutorials to get started on Xuggle I suggest that you take a look at Xuggle Wiki. This page should help you to understand basic use of video encoding/decoding.
Then you should be able to adapt the source code of examples. I think you could use this example to combine your 2 flv files. Of course, you will need to change it to combine 2 video files.

How can I split a video file by Java

I wanna split a video file into several fragments which can be played individually.
Is there any java library can be used in this situation?
Or if Xuggle can be used, can anyone give me an simple example.
Thanks
A video file? There's quite a few video codecs, file formats. For a general solution try ffmpeg it's not a Java library but runs on all platforms.

Video converting into mp3 on Java, Android

I need to convert mp4/flv files info mp3 in my Android application, but I don't know C/C++ and Android NDK. Do you know libraries/methods for easy converting on Java? Thank you for anyway.
Your question is how to extract audio from MP4/ FLV files and save as mp3 file. Right ?
Then, very sorry, Android SDK does not provide any API for transformating or track extraction.
Also using available media framework to achieve the same is also not trivial (and even if you do, you will lose portability).
What I would suggest is to use your MP4 & FLV Parser to extract audio track, do transcoding (if audio track is non-mp3), and save the transcoded (if audio track extracted is mp3, then extracted data) data.
Or you can port FFMPEG code base and use the same. This again may be overkill for your small task.
Suppose you just want to extract mp3 track from MP4, then you understand the native mp4 parser and use the APIs for extraction. You may have to replicate some code from stagefright / opencore.
Shash
it's probably irrelevant for you anymore but if some one still need a mp4 to mp3 parser here's an api that can do the job

Display sound (.wav/.mp3) as graph in Java

I need to display a graph of a sound file - i.e. a wave form as displayed by audio editors such as Audacity.
How should I go about this? Is there anything in the Java Sound API that can help me?
In Java Sound API poke around AudioSystem.getAudioInputStream
which will return AudioInputStream which shows you how to open audio files form within Java. It is good enough to read .wav files, but not quite so for mp3s.
It lets you read bytes one by one directly. Also getAudioFormat will return object that has sample rate, bit/sample, etc. After reading your waveform you can draw it in your favorite way on the screen (Swing, AWT, png file on the web, etc.).
In the end I found code to do exactly what I wanted in Chapter 10 of the book Swing Hacks.

Categories

Resources