[英]How to create mp4 file from h264 encoded frames on android?
I have some h264 frames already encoded with android encoder. 我有一些已经用android编码器编码的h264帧。 Now i want to create and write them one by one to the mp4 file. 现在,我要创建它们并将它们一个一个地写入mp4文件。 Please advise how to do this on android in Java. 请告知如何在Java中的android上执行此操作。 I don't want to use OpenCV or native code. 我不想使用OpenCV或本机代码。
mp4-parser can't do this as i understand mp4-parser无法做到这一点,据我了解
navite MPEG4Writer is too complicated to use navite MPEG4Writer使用起来过于复杂
Wondering why such a common and very useful thing as mp4 writer NOT FROM CAMERA is not implemented in android 想知道为什么没有在android中实现像MP4编写器NOT FROM CAMERA这样的常见且非常有用的东西
You may use my mp4parser project. 您可以使用我的mp4parser项目。 You can mux H264 and AAC in pure Java with it: 您可以使用它在纯Java中混合使用H264和AAC:
H264TrackImpl h264Track = new H264TrackImpl(new FileInputStream("raw.h264").getChannel());
Movie m = new Movie();
m.addTrack(h264Track);
IsoFile out = new DefaultMp4Builder().build(m);
FileOutputStream fos = new FileOutputStream(new File("h264_output.mp4"));
out.getBox(fos.getChannel());
fos.close();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.