我基本上有一个字节矩阵。每行(即byte[])代表一张图片。如何将它们制作成电影(任何格式 - avi,mpeg,等等),并保存为文件?每个图像可以是以下之一:
int JPEG Encoded formats.
int NV16 YCbCr format, used for video.
int NV21 YCrCb format used for images, which uses the NV21 encoding format.
int RGB_565 RGB format used for pictures encoded as RGB_565.
int YUY2 YCbCr format used for images, which uses YUYV (YUY2) encoding format.
int YV12 Android YUV format: This format is exposed to software decoders and applications.
只要我能创建电影,我可以选择任何我喜欢的格式。
public void createMovie(byte[][] images) {
// and ideas on what to write here?
}
我不需要实际的实现,只需告诉我思路以及所需的外部库(如有需要)。
我还需要在创建影片之前编辑一些图像(字节流),以添加一些文本。我该如何做?
解决方案必须是“仅限Java”!没有外部程序,没有外部命令(但我可以使用外部JAR包)。
谢谢!
ffmpeg
来实现您的目标,我可以证明该答案中的示例是有效的,可以从图像数组生成视频。 - iggy12345