我正在尝试像这样用 xuggle 打开一个视频文件:
if (container.open(in, null) < 0) {
throw new IllegalArgumentException("could not open file: ");
}
当我使用 mp4 文件并通过打开 InputStream 时出现问题:
InputStream in = new FileInputStream(filename);
在这种情况下,IContainer.open 保持阻塞并且不返回任何内容。
但是,如果我将文件名传递给打开方法或者我使用 flv 格式,它就可以正常工作。
我必须将 InputStream 与 mp4 文件一起使用。
有人可以帮我找到问题吗?
最佳答案
如果其他人遇到这个问题,我会说我做了什么来解决我的问题:
我没有从 InputStream
打开,而是直接使用
if (container.open(filename, IContainer.Type.READ, null) < 0)
{
throw new IllegalArgumentException("Could not open file: " + filename);
}
我希望这对以后遇到此问题的人有所帮助。干杯。
关于java - Xuggler:IContainer.open() block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21428852/