Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android , Java - Rendering a video using bitmap frames to reverse a video (Xuggler)

I am having no of video frames in ArrayList<Bitmap>. I have accessed this frames using MediaMetadataRetriever.getFrameAtTime() method over a Video file(.mp4).

i reverse the order of frames in ArrayList. Now using this reverse ordered frame queue i want to render a video so dat it would get reversed (i hope i am on right track).

After creating that video i also want to save it to sd Card.

how to achieve this? Or Is der any other method to reverse a video in java?

Edit 1: (***Using xuggler*)**

i tried using xuggler ... i tried using it's .jar file. but it is throwing some errors.

[2012-08-18 00:29:16 - xugglertest2] The library 'xuggle-xuggler-5.2.jar' contains native libraries that will not run on the device.
    [2012-08-18 00:29:16 - xugglertest2]  The following libraries were found:
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/i686-pc-linux-gnu/libxuggle-ferry.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/i686-pc-linux-gnu/libxuggle-xuggler-io.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/i686-pc-linux-gnu/libxuggle-xuggler.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/i686-pc-linux-gnu/libxuggle.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/x86_64-pc-linux-gnu/libxuggle-ferry.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/x86_64-pc-linux-gnu/libxuggle-xuggler-io.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/x86_64-pc-linux-gnu/libxuggle-xuggler.so
    [2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/x86_64-pc-linux-gnu/libxuggle.so

What should i do ??

i copied xuggler-xuggler-5.4.jar in libs folder of project and then add it to build path. m i doing it correctly?



Edit 2: (Using ffmpeg)
I have compiled ffmpeg for android on ubuntu platform as per given Here
I got compiled files as per the document.
Now can anybody tell me how can i use those compiled files in android application? what exactly should i do with those files??
I didn't find any suitable documentation. any help would be gr8.


Edit 3 : (Ported to android -ffmpeg)

hey.. finally i compiled ffmpeg on ubuntu i got libffmpeg.so. I ported it to android successfully. libffmpeg.so is loading in android activity successfully. Now i just want to test a simple ffmpeg command or program.
can you suggest where shall i look for it.? can you suggest me a sample command to test it.

Thanks and regards

like image 510
Chaitanya Chandurkar Avatar asked Aug 12 '12 09:08

Chaitanya Chandurkar


1 Answers

You can use ffmpeg to assemble video from images. You can integrate ffmpeg in Java(Android) in a couple of ways (one being directly running it via

Runtime.getRuntime().exec("ffmpeg <options>");

), but probably a good way to do it is via the Xuggler project - it heavily relies on ffmpeg. For starting point, here's a set of introduction tutorials and here's a complete tutorial how to encode video from sequence of images. It's a lot of work and reading, but all the information you need is there. Good luck!

like image 63
hovanessyan Avatar answered Nov 11 '22 12:11

hovanessyan