我想從本地讀取使用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");
有什麼建議嗎?