我想从本地读取使用Xuggle的mov文件。 这给了我下面的错误:Java - xuggle/ffmpeg - mov原子未找到
30-mag-2011 15.56.55 com.xuggle.ferry.NativeLogger log
GRAVE: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102840600] moov atom not found
的问题是,直到前两分钟没有给出任何错误和代码是一样的。
然而,我发现这一点:
如果我使用一个字节数组打开的IContainer它不工作,并给我的错误:
ByteArrayInputStream b = new ByteArrayInputStream(file);
DataInputStream data = new DataInputStream(b);
IContainer container = IContainer.make();
if (container.open(data, null) < 0)
throw new IllegalArgumentException("E001 - Cannot open the container");
如果我打开使用临时文件的IContainer有用。
File temp = File.createTempFile("temp_", ".mov");
try
{
FileOutputStream fos = new FileOutputStream(temp);
fos.write(file);
fos.close();
}
catch(FileNotFoundException e)
{
System.out.println(e);
}
IContainer container = IContainer.make();
if (container.open(temp.toString(), IContainer.Type.READ, null) < 0)
throw new IllegalArgumentException("E001 - Cannot open the container");
有什么建议吗?