尝试转换视频但文件为空

时间:2015-01-15 11:49:23

标签: java ffmpeg

尝试{                         文件encodingFile = new File(“c:\ ffmpeg \ bin \ output.mp4”);                         ProcessBuilder pb = new ProcessBuilder(“c:\ ffmpeg \ bin \ ffmpeg.exe”,“ - i”,“c:\ ffmpeg \ bin \ input.mp4”,“ - y”,“ - s”,“1440” +“x”+“ - 1”,“ - vcodec”,“libx264”,“c:\ ffmpeg \ bin \ outfile.mp4”); //或其他命令....                         encodingFile.createNewFile();                         pb.redirectErrorStream(真);                         pb.redirectInput(ProcessBuilder.Redirect.PIPE); //可选的默认行为                         pb.redirectOutput(encodingFile);                         过程p = pb.start();                         尝试{                             //如果你想等待这个过程结束                             p.waitFor();                              gui.textArea1.append(“\ n + ++++++++++++++++++++++++++++                         } catch(InterruptedException ex){                              gui.textArea1.append(“\ nInterruptedException:”+ ex.getMessage());                         }                         //encodingFile.delete();

                }catch(IOException ex){
                    gui.textArea1.append("\nIOException converting: "+ex.getMessage());
                } 

我不确定上面的代码到底是做什么的,但我正在尝试将带有缩放滤镜-1的视频转换为高度以保持宽高比。我只得到一个没有视频的空输出文件。你能帮助我ffmpeg在java?在此先感谢: - )

0 个答案:

没有答案