Question

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

Was it helpful?

Solution

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!

OTHER TIPS

Regarding your xuggler usage, the version of your library won't work on your specific device, as it contains native code compiled for x86_64 and i686 platforms:

[2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/i686-pc-linux-gnu/
[2012-08-18 00:29:16 - xugglertest2]  - com/xuggle/ferry/x86_64-pc-linux-gnu/

try finding version of this library with native code parts compiled for ARMv6 (most common Android architecture - includes older devices, if don't want to support devices older than ~1-2 years ago, ARMv7 would be better).

Otherwise, you'll need to get the ffmpeg compiled for ARM and use it with support of Android NDK. You'll need to write a code in C/C++ implementing encoding your series of images into a specific file and wrap it up with JNI interface. You can pass Java arrays to native implementations of class' methods.

please see sample Android NDK applications in SDK samples to see how to use JNI in your code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top