我試圖運行一個xuggler的InputOutputStreamHandler的例子。我試圖將視頻轉換爲FLV並將結果視頻寫入標準輸出。這裏的源代碼:xuggler InputOutputStreamHandler SIGSEGV
import java.io.IOException;
import java.io.OutputStream;
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.xuggler.io.InputOutputStreamHandler;
import com.xuggle.xuggler.io.XugglerIO;
public class Test {
public static void main(String[] args) throws IOException {
OutputStream outStream = System.out;
InputOutputStreamHandler handler = new InputOutputStreamHandler(outStream);
IMediaReader reader = ToolFactory.makeReader("myvideo.flv");
IMediaWriter writer = ToolFactory.makeWriter(XugglerIO.map(XugglerIO
.generateUniqueName(handler, ".flv"), handler), reader);
reader.addListener(writer);
while(reader.readPacket() == null);
}
}
我的問題是,當我嘗試運行此程序,它崩潰,我得到以下錯誤:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3ed28442e8, pid=9103, tid=139908218222336
#
# JRE version: 7.0_21-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [xuggle5976644928112967115.tmp+0x2f02e8] avio_write+0x18
...
文件hs_err_pid.log提到:
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.xuggle.xuggler.XugglerJNI.IContainer_writeHeader(JLcom/xuggle/xuggler/IContainer;)I+0
j com.xuggle.xuggler.IContainer.writeHeader()I+5
j com.xuggle.mediatool.MediaWriter.getStream(I)Lcom/xuggle/xuggler/IStream;+222
j com.xuggle.mediatool.MediaWriter.encodeAudio(ILcom/xuggle/xuggler/IAudioSamples;)V+17
j com.xuggle.mediatool.MediaWriter.onAudioSamples(Lcom/xuggle/mediatool/event/IAudioSamplesEvent;)V+16
j com.xuggle.mediatool.AMediaToolMixin.onAudioSamples(Lcom/xuggle/mediatool/event/IAudioSamplesEvent;)V+31
j com.xuggle.mediatool.MediaReader.dispatchAudioSamples(ILcom/xuggle/xuggler/IAudioSamples;)V+14
j com.xuggle.mediatool.MediaReader.decodeAudio(Lcom/xuggle/xuggler/IStreamCoder;Lcom/xuggle/xuggler/IPacket;)V+91
j com.xuggle.mediatool.MediaReader.readPacket()Lcom/xuggle/xuggler/IError;+131
j Test.main([Ljava/lang/String;)V+45
v ~StubRoutines::call_stub
有誰知道我該怎麼繞過這個問題?
預先感謝您!
只是一個快速更新,這似乎是一個Xuggler 5.4的bug。 – ifoukarakis