I want to create a video using images from a sdcard through my application in android.
Asked
Active
Viewed 4,054 times
2 Answers
1
Use Frame animation
An animation defined in XML that shows a sequence of images in order (like a film).
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot=["true" | "false"] >
<item
android:drawable="@[package:]drawable/drawable_resource_name"
android:duration="integer" />
</animation-list>

Padma Kumar
- 19,893
- 17
- 73
- 130
-
I understood what you have explained above but how to retrieve images from sd card and convert into video files.Actually i am looking for converting jpeg into mpeg or 3gp format. – Sai Dec 12 '11 at 09:22
-
Programmatic frame by frame animation examle - AnimationDrawable http://androidforums.com/application-development/11620-programmatic-frame-frame-animation-examle-animationdrawable.html – Padma Kumar Dec 12 '11 at 09:52
0
Try this code,
path = Environment.getExternalStorageDirectory() + "/Testing/";
commandEditText.setText(
"-loop 1 -i "+path+"images_001.jpg " +
"-loop 1 -i "+path+"images_002.jpg " +
"-loop 1 -i "+path+"images_003.jpg " +
"-loop 1 -i "+path+"images_004.jpg " +
"-loop 1 -i "+path+"images_005.jpg " +
"-filter_complex " +
"[0:v]setsar=sar=40/33,trim=duration=1,fade=t=out:st=14.5:d=0.5[v0];" +
"[1:v]setsar=sar=40/33,trim=duration=1,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v1];" +
"[2:v]setsar=sar=40/33,trim=duration=1,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v2];" +
"[3:v]setsar=sar=40/33,trim=duration=1,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v3];" +
"[4:v]setsar=sar=40/33,trim=duration=1,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v4];" +
"[v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v] -map [v] "+path+"out.mp4");
}

bhumika rijiya
- 440
- 1
- 5
- 42