* .mov 파일을 ffmpeg를 호출하는 JAVE를 사용하여 * .mp4 파일로 변환하려고합니다. 입력 파일과 출력 파일은 모두 InputStream 및 OutputStream 형식입니다. 즉, ffmpeg에 대해 InputStream 및 OutputStream을 -i 및 -y parematers로 전달해야 함을 의미합니다. 어떻게하면됩니까?FileInputStream 및 FileOutputStream을 ffmpeg에 전달하여 (JAVE-Java 오디오 비디오 인코딩 사용)
//Read a movfile.mov converted into a FileInputStream
InputStream fileInputStream = getFileInputStream();
OutputStream fileOutputStream = new FileOutputStrea(outputMP4File) //Output
Process p = Runtime.exec("ffmpeg -i - -y -");
InputStream pInStrm = p.getInputStream();
OutputStream pOutStrm = p.getOutputStream();
int vin = 0, vout = 0;
Thread read = new Thread() {
byte[] buff = new byte[4096];
void run() {
while ((vin=fileInputStream.read(buf))!=-1) {
pOutStrm.write(buf, 0, vin);
}
}
}; read.start();
Thread write = new Thread() {
byte[] buff = new byte[4096];
void run() {
while ((vout=pInStrm.read(buf))!=-1) {
fileOutputStream.write(buf, 0, vout);
}
}
}; write.start();
하지만 계속 "IOException : pipe is closed"오류가 발생합니다. 누군가 나를 도울 수 있을까요? 는 (Windows 및 레드햇 리눅스)이 트랜스 코딩을 할 수있는 자바 API가 또는 경우, 그것은 그런 식으로 작동하지 않을
감사