How to Create a Video from a BufferedImage List? - java

I'm trying to create a Simple Recording Software, so i Created a List<BufferedImage> for Storing the Frames, so how do i convert this in a Video? Most of the Stuff that i found is About Xuggler(That is very dead) and i also want a method that allows me to add Audio to the Video

i didn't get any responses so after a pretty long time searching i solved it with ffmpeg

Related

Detect video or audio track in a raw MP4 data

is there a way to detect either a Video or Audio track present in a raw MP4 data?
I have downloaded a raw MP4 data (with some size) from a URL with a range request. It is not a full MP4 data.
I am using MP4Parser to do this job.
What I have tried is I am trying to build a Movie object from the above MP4 data. But it throws exception saying that there are no tracks in it.
Any idea would be much appreciated how to construct Movie object from a raw MP4 data.
Thanks
without the original moov box, the file is pretty much worthless. It is possible to locate the frames in the mdat and reconstruct a new moov with some forensic analysis, but its almost certainly not work the effort or cost dot so.

How to record a live stream video using java swing

I want to know that is it possible to record and save alive stream using Java swing satndalone application.If so please provide with some example.
Think a stream URL is mms://192.168.2.1:7700 , and i want to save the video along with playing.Help is appreciated accordingly.

Display image as 'video'

I have an image file (for example img.png) which is updated (overwritten) every 20-30ms using a java program.
Now, I want the client to be able to 'watch' the image as it changing (it will look like a video streaming).
I used Javascript to update the image every 20-30ms but it is not that efficient as it consumes a lot of processing power. I also tried to use Ajax and jQuery.
Any suggestions on how to improve the performance? Can I use a player like jwPlayer or Flow Player? Should I use something different and more efficient?
Thanks.
PS. I have already implemented it using JApplet but I would like to avoid that solution.
You can update image by appending a random string at the end.
function update(){
$('#image').attr('src', $('#image').attr('src')+'?'+Math.random());
}
setTimeout("update()",150);
sounds like you just want a slideshow; there are super fast efficient slideshows in JavaScript, i'm lazy so here's the jQuery version:http://mathiasbynens.be/demo/slideshow if you're having performance issues using this, it's not because of the slideshow
You can update image using javascript timer (setTimeout) eg url
..it consumes a lot of processing power
Note that 'processing power' is not the same as 'bandwidth'.
To save bandwidth, it would make more sense to assemble the images into a video at the server side, and stream the video to the client. Video compression formats generally save a lot of bytes over a series of images, because they can compress images taking into account similar parts of different frames.

Recording audio in android

I want to record own voice or any through mic(In any way) into a file in my project and want to read later and listen to it.How can i do this? Anyone reply me please.
http://developer.android.com/guide/topics/media/index.html
About 3/4 the way down the page you'll see
Performing Audio Capture
Audio capture from the device is a bit more complicated than audio and video playback, but still fairly simple:
Create a new instance of android.media.MediaRecorder.
Set the audio source using MediaRecorder.setAudioSource(). You will probably want to use MediaRecorder.AudioSource.MIC.
Set output file format using MediaRecorder.setOutputFormat().
Set output file name using MediaRecorder.setOutputFile().
Set the audio encoder using MediaRecorder.setAudioEncoder().
Call MediaRecorder.prepare() on the MediaRecorder instance.
To start audio capture, call MediaRecorder.start().
To stop audio capture, call MediaRecorder.stop().
When you are done with the MediaRecorder instance, call MediaRecorder.release() on it. Calling MediaRecorder.release() is always recommended to free the resource immediately.
Followed by code showing exactly how to store audio input and play it back, hope this helps. (I tried to paste the code here but pasting from android's guides is difficult)

Android: mpeg4/H.264 packetization example

I need to split mpeg4 video stream (actually from android video camera) to send it through RTP.
The specification is little large for quick reference.
I wonder if there any example/open source code for mpeg4 packetization?
Thanks for any help !
Mpeg4 file format is also called ISO/IEC 14496-14. Google it any you will find specifications.
However, what you are trying to do (RTP publisher) will be hard for the following reasons:
Mpeg4 has header at the end of the file. Which means header will be written out only when video stream is finished. Since you want to do real time video streaming you will need to guess where audio and video packets start/end. This will not be the same on all Android devices as they might use different video sizes and codec parameters. So your code will be device-dependent and you'll need to support and test many different devices.
Some devices do not flush video data to file in regular intervals. Some only flush once a minute or so. This will break your real-time stream.
There is no example code. I know because I looked. There are a few companies that do something similar, but mainly they skip RTP. Instead they progressively upload the file to their own server and then implement video/audio stream "chopping" and then insert it into their video/transcoder backend. I used to work for one of those companies and that's how we did it. AFAIK competition took similar approaches. The upside is that all complexity is on server an you do not need to update clients when something breaks or new devices arrive on the market.

Categories