简体   繁体   中英

How can I create h264 video from series of images on Android

I am using jcodec to create video from series of images on android. Then I have to add audio to that video. I have tested mp4parser library and it works probably. The problem is that Jcodec in Android( NOT JAVA) is only produce MP4 but cannot generate h264 and mp4parser needs h264 as an input. Anyone knows how can I create Raw h264 video from series of images in Android?

Thanks a lot

You can easily use an MP4 clip as input for the muxing process:

    Movie m = MovieCreator.build("Path/to/your/video-mp4");
    AACTrackImpl audio = new AACTrackImpl(new FileDataSourceImpl("Path/to/your/aac"));
    m.addTrack(audio);

    Container c = new DefaultMp4Builder().build(m);
    c.writeContainer(new FileOutputStream("/path/to/your/destination.mp4").getChannel());

I hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM