Using jcodec SequenceEncoder
Asked Answered
P

1

7

I need to create video from images, I have seen jcodec and I think it is what I need: http://jcodec.org/

How do I add jcodec to my project? I have seen there is a version for android. Correct me if I am wrong, but I added jcodec-0.1.5.jar to my project under the libs folder. Then added SequenceEncoder.java and BitmapUtil.java from jcodec-android-0.1.7.zip to my package but when I add:

public void encodeImage(Bitmap bi) throws IOException 
{
    encodeNativeFrame(BitmapUtil.fromBitmap(bi));
}

It gives me error on package com.example.seqtest and asks me to configure build path.

So how I use it, How can I input sequence of images? Can you provide me some example?

Pee answered 11/12, 2013 at 13:40 Comment(0)
S
14

This is how you do it

1) Download jcodec-android-0.1.7.zip from http://jcodec.org/

2) Unzip the downloaded file and you will get JCodec folder which is an android project.

3) Import that JCodec project in your Eclipse. If you get any error, solve it by right clicking on the project Properties -> Android -> Select the Build target and press OK.

4) Now your JCodec library setup is done.

5) Create a new android application project.(your actual project)

6) Right click on the project, Properties -> Android -> Library -> Add -> Add the JCodec Library -> Apply -> OK

7) Now your project is linked to JCodec library and you can start coding.

You can download JCodec sample app from this link http://jcodec.org/downloads/jcodec-samples-android-0.1.7.zip

Again you have to carry out step 6 for sample app too.And no need to add jcodec-0.1.5.jar to libs folder.

Soule answered 17/12, 2013 at 9:20 Comment(5)
I did that already, there is some conflict problem. When I name the function encodeIm I am not getting the error, but still it does not work. The app is compiling but I get errors when I run it. I need some tutorial about the whole processPee
Thank you! Finally I created video filePee
Hi @Dim, have you tried to change duration/fps or images on video ?Unsought
@AbhishekV I updated to jcodec_0.1.7 as you suggested, but resultingly it removed a few methods like SequenceEncoder.encodeImage(bitmap,seconds); How to fix this?Nimitz
@AbhishekV : In sample code, startDecode(View view) in FileChooserDialog statement giving error and does not import any class. I implemeted your way for setting up jcodec library.Windsail

© 2022 - 2024 — McMap. All rights reserved.