How to create video through an image sequence?

Asked

Viewed 128 times

2

I want to create a video using a image set of the same type and size.

I researched some examples but did not succeed in performing the algorithm. Of the examples, this link was the most complete:

https://stackoverflow.com/questions/14337091/video-encode-from-sequence-of-images-from-java-android

However, the answer does not mention all packages .jar used, I searched the missing on the internet but did not find the correct version.

I’m looking for an alternative way or solution to this link example.

1 answer

2

Fala Cristian,

You can use the Animation function of Android, for example:

Create a file xml animation.

<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">
    <item android:drawable="@drawable/imagem1" android:duration="100"/>
    <item android:drawable="@drawable/imagem2" android:duration="100"/>
    <item android:drawable="@drawable/imagem3" android:duration="100"/>
    <item android:drawable="@drawable/imagem4" android:duration="100"/>
</animation-list>

Then you create an Imageview in your layout, example:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/animacao"/>

</LinearLayout>

Then you just instill in Java and call the animation, example:

ImageView imageView = (ImageView) findViewById(R.id.animacao);
imageView.setBackgroundResource(R.drawable.animacao);

AnimationDrawable animation = (AnimationDrawable) imageView.getBackground();
animation.start();

It’ll work like a video, solve your case?

Hugs.

  • Very nice, but I really need to form a video.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.