I am using xuggler to transcode videos into different formats. If I open my IContainer directly from a file, it works perfectly, however, this time I want to open IContainer use an InputStream. Strange thing is I tried to open a mp4 format video via FileInputStream, the IContainer can be opened using this FileInputStream, but I cannot read Ipacket in this stream. Can someone give me some suggestions? Did miss something? I really need my xuggler to deal with streams
public static void main(String[] args) throws IOException {
//the file input stream
FileInputStream fi = new FileInputStream("test.mp4");
//icontainer format
IContainerFormat format = IContainerFormat.make();
format.setInputFormat("mp4");
IContainer container = IContainer.make();
//open container via FileInputStream
int data = container.open(fi, format);
IPacket packet = IPacket.make();
//read packet
int info = container.readNextPacket(packet);
System.out.println(data);
System.out.println(info);
}
results
data: 0
info: -1094995529
According to IError, an unknown error here when I tried to read a packet. I'm using xuggler 5.4