diff --git a/src/application/Settings.java b/src/application/Settings.java index a5397858..461b35de 100644 --- a/src/application/Settings.java +++ b/src/application/Settings.java @@ -177,7 +177,7 @@ public Settings() { txtImageDuration.setName("txtImageDuration"); comboLanguage.setName("comboLanguage"); - frame.setSize(370, 742); + frame.setSize(370, 750); if (Shutter.getLanguage.equals(Locale.of("ru").getDisplayLanguage()) || Shutter.getLanguage.equals(Locale.of("uk").getDisplayLanguage())) { frame.setSize(frame.getWidth() + 50, frame.getHeight()); @@ -484,24 +484,24 @@ public void actionPerformed(ActionEvent arg0) { if (Settings.txtCustomFFmpegPath.getText().equals("") == false) { - VideoPlayer.PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); + FFMPEG.PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); } } else { txtCustomFFmpegPath.setEnabled(false); - VideoPlayer.PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); + FFMPEG.PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); if (System.getProperty("os.name").contains("Windows")) { - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(1,VideoPlayer.PathToFFMPEG.length()-1); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,(int) (VideoPlayer.PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(1,FFMPEG.PathToFFMPEG.length()-1); + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,(int) (FFMPEG.PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; } else { - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,VideoPlayer.PathToFFMPEG.length()-1); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,(int) (VideoPlayer.PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,FFMPEG.PathToFFMPEG.length()-1); + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,(int) (FFMPEG.PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; } } @@ -542,24 +542,24 @@ public void keyReleased(KeyEvent e) { if (Settings.txtCustomFFmpegPath.getText().equals("") == false) { - VideoPlayer.PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); + FFMPEG.PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); } } else { txtCustomFFmpegPath.setEnabled(false); - VideoPlayer.PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); + FFMPEG.PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); if (System.getProperty("os.name").contains("Windows")) { - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(1,VideoPlayer.PathToFFMPEG.length()-1); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,(int) (VideoPlayer.PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(1,FFMPEG.PathToFFMPEG.length()-1); + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,(int) (FFMPEG.PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; } else { - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,VideoPlayer.PathToFFMPEG.length()-1); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,(int) (VideoPlayer.PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,FFMPEG.PathToFFMPEG.length()-1); + FFMPEG.PathToFFMPEG = FFMPEG.PathToFFMPEG.substring(0,(int) (FFMPEG.PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; } } @@ -1774,7 +1774,7 @@ else if (eElement.getElementsByTagName("Name").item(0).getFirstChild().getTextCo //customFFmpeg if (btnCustomFFmpegPath.isSelected() && txtCustomFFmpegPath.getText().equals("") == false) { - VideoPlayer.PathToFFMPEG = txtCustomFFmpegPath.getText(); + FFMPEG.PathToFFMPEG = txtCustomFFmpegPath.getText(); } } } diff --git a/src/application/Shutter.java b/src/application/Shutter.java index 9d524ab2..cc9107d7 100644 --- a/src/application/Shutter.java +++ b/src/application/Shutter.java @@ -885,6 +885,9 @@ public void windowStateChanged(WindowEvent arg0) { Settings.txtThreads.setText("0"); Settings.txtImageDuration.setText("10"); + //Initialize FFmpeg path + FFMPEG.getFFmpegPath(); + Splash.increment(); topPanel(); Splash.increment(); @@ -23986,23 +23989,26 @@ public static void enfOfFunction() { scrollPane.getViewport().setOpaque(false); scrollPane.setPreferredSize( new Dimension( 500, 400 ) ); - Object[] moreInfo = {"OK", language.getProperty("menuItemConsole")}; - - int result = JOptionPane.showOptionDialog(Shutter.frame, scrollPane, Shutter.language.getProperty("notProcessedFiles"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, moreInfo, null); - - if (result == JOptionPane.NO_OPTION) + if (scanIsRunning == false) { - if (Console.frmConsole != null) + Object[] moreInfo = {"OK", language.getProperty("menuItemConsole")}; + + int result = JOptionPane.showOptionDialog(Shutter.frame, scrollPane, Shutter.language.getProperty("notProcessedFiles"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, moreInfo, null); + + if (result == JOptionPane.NO_OPTION) { - if (Console.frmConsole.isVisible()) + if (Console.frmConsole != null) { - Console.frmConsole.toFront(); - } + if (Console.frmConsole.isVisible()) + { + Console.frmConsole.toFront(); + } + else + new Console(); + } else new Console(); - } - else - new Console(); + } } if (RenderQueue.frame != null && RenderQueue.frame.isVisible()) diff --git a/src/application/VideoPlayer.java b/src/application/VideoPlayer.java index f1288d1c..3b881b55 100644 --- a/src/application/VideoPlayer.java +++ b/src/application/VideoPlayer.java @@ -104,7 +104,6 @@ public class VideoPlayer { //Player - public static String PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); public static JPanel player; public static Process playerVideo; public static Process bufferVideo; @@ -227,22 +226,6 @@ public VideoPlayer() { showInfoMessage = true; - if (System.getProperty("os.name").contains("Windows")) - { - PathToFFMPEG = PathToFFMPEG.substring(1,PathToFFMPEG.length()-1); - PathToFFMPEG = PathToFFMPEG.substring(0,(int) (PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; - } - else - { - PathToFFMPEG = PathToFFMPEG.substring(0,PathToFFMPEG.length()-1); - PathToFFMPEG = PathToFFMPEG.substring(0,(int) (PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; - } - - if (Settings.btnCustomFFmpegPath.isSelected() && Settings.txtCustomFFmpegPath.getText().equals("") == false) - { - PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); - } - GraphicsConfiguration config = Shutter.frame.getGraphicsConfiguration(); GraphicsDevice myScreen = config.getDevice(); GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); @@ -611,26 +594,26 @@ public static void playerProcess(float inputTime) { if (System.getProperty("os.name").contains("Windows")) { //VIDEO STREAM - ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + setVideoCommand(inputTime, player.getWidth(), player.getHeight(), playerPlayVideo)); + ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + FFMPEG.PathToFFMPEG + '"' + setVideoCommand(inputTime, player.getWidth(), player.getHeight(), playerPlayVideo)); playerVideo = pbv.start(); //AUDIO STREAM if ((casePlaySound.isSelected() && inputTime > 0 && (mouseIsPressed == false || FFPROBE.audioOnly)) || mouseIsPressed == false) { - ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + setAudioCommand(inputTime, false)); + ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + FFMPEG.PathToFFMPEG + '"' + setAudioCommand(inputTime, false)); playerAudio = pba.start(); } } else { //VIDEO STREAM - ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", PathToFFMPEG + setVideoCommand(inputTime, player.getWidth(), player.getHeight(), playerPlayVideo)); + ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", FFMPEG.PathToFFMPEG + setVideoCommand(inputTime, player.getWidth(), player.getHeight(), playerPlayVideo)); playerVideo = pbv.start(); //AUDIO STREAM if ((casePlaySound.isSelected() && inputTime > 0 && (mouseIsPressed == false || FFPROBE.audioOnly)) || mouseIsPressed == false) { - ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", PathToFFMPEG + setAudioCommand(inputTime, false)); + ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", FFMPEG.PathToFFMPEG + setAudioCommand(inputTime, false)); playerAudio = pba.start(); } } @@ -811,13 +794,13 @@ private static void playerPlayAudioOnly(float inputTime) { if (System.getProperty("os.name").contains("Windows")) { //AUDIO STREAM - ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + setAudioCommand(inputTime, true)); + ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + FFMPEG.PathToFFMPEG + '"' + setAudioCommand(inputTime, true)); playerAudio = pba.start(); } else { //AUDIO STREAM - ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", PathToFFMPEG + setAudioCommand(inputTime, true)); + ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", FFMPEG.PathToFFMPEG + setAudioCommand(inputTime, true)); playerAudio = pba.start(); } @@ -1154,7 +1137,7 @@ public static void setMedia() { { @Override public void run() - { + { if (FFMPEG.isRunning == false || (Shutter.btnStart.getText().equals(Shutter.language.getProperty("btnPauseFunction")) == false && Shutter.btnStart.getText().equals(Shutter.language.getProperty("resume")) == false @@ -1189,7 +1172,7 @@ public void run() } //Reset when changing file - if (Shutter.fileList.getSelectedValue().equals(videoPath) == false) + if (Shutter.fileList.getSelectedValue().equals(videoPath) == false && (new File(Shutter.fileList.getSelectedValue()).isFile() || Shutter.scanIsRunning)) { //IMPORTANT if (FFPROBE.isRunning) @@ -2037,10 +2020,10 @@ else if (System.getProperty("os.name").contains("Mac")) if (System.getProperty("os.name").contains("Windows")) { - codec = VideoEncoders.setCodec() + VideoEncoders.setBitrate() + AdvancedFeatures.setPreset() + yadif + freezeFrame + " -an -f " + format + " pipe:1 | " + '"' + PathToFFMPEG + '"' + " -v quiet -hide_banner -i pipe:0" + setFilter("", speed, false); + codec = VideoEncoders.setCodec() + VideoEncoders.setBitrate() + AdvancedFeatures.setPreset() + yadif + freezeFrame + " -an -f " + format + " pipe:1 | " + '"' + FFMPEG.PathToFFMPEG + '"' + " -v quiet -hide_banner -i pipe:0" + setFilter("", speed, false); } else - codec = VideoEncoders.setCodec() + VideoEncoders.setBitrate() + AdvancedFeatures.setPreset() + yadif + freezeFrame + " -an -f " + format + " pipe:1 | " + PathToFFMPEG + " -v quiet -hide_banner -i pipe:0" + setFilter("", speed, false); + codec = VideoEncoders.setCodec() + VideoEncoders.setBitrate() + AdvancedFeatures.setPreset() + yadif + freezeFrame + " -an -f " + format + " pipe:1 | " + FFMPEG.PathToFFMPEG + " -v quiet -hide_banner -i pipe:0" + setFilter("", speed, false); cmd = gpuDecoding + Colorimetry.setInputCodec(extension) + " -strict -2 -v quiet -hide_banner -ss " + (long) (inputTime * inputFramerateMS) + "ms" + concat + " -i " + '"' + video + '"' + " -r " + FFPROBE.currentFPS + codec + freezeFrame + " -c:v bmp -an -f image2pipe -"; } @@ -5195,12 +5178,12 @@ private static void generatePreview(String cmd) { if (System.getProperty("os.name").contains("Windows")) { - ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + cmd); + ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + FFMPEG.PathToFFMPEG + '"' + cmd); process = pbv.start(); } else { - ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", PathToFFMPEG + cmd); + ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", FFMPEG.PathToFFMPEG + cmd); process = pbv.start(); } diff --git a/src/functions/Picture.java b/src/functions/Picture.java index 2322f618..21812eb0 100644 --- a/src/functions/Picture.java +++ b/src/functions/Picture.java @@ -291,12 +291,12 @@ public void run() { Process process; if (System.getProperty("os.name").contains("Windows")) { - ProcessBuilder pbv = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " -v quiet -hide_banner -i pipe:0" + logo + cmd + '"' + fileOut + '"'); + ProcessBuilder pbv = new ProcessBuilder('"' + FFMPEG.PathToFFMPEG + '"' + " -v quiet -hide_banner -i pipe:0" + logo + cmd + '"' + fileOut + '"'); process = pbv.start(); } else { - ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", VideoPlayer.PathToFFMPEG + " -v quiet -hide_banner -i pipe:0" + logo + cmd + '"' + fileOut + '"'); + ProcessBuilder pbv = new ProcessBuilder("/bin/bash", "-c", FFMPEG.PathToFFMPEG + " -v quiet -hide_banner -i pipe:0" + logo + cmd + '"' + fileOut + '"'); process = pbv.start(); } diff --git a/src/library/FFMPEG.java b/src/library/FFMPEG.java index 85d797a1..9345b660 100644 --- a/src/library/FFMPEG.java +++ b/src/library/FFMPEG.java @@ -87,6 +87,7 @@ public class FFMPEG extends Shutter { +public static String PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); public static int fileLength = 0; public static boolean error = false; public static boolean isRunning = false; @@ -132,6 +133,25 @@ public class FFMPEG extends Shutter { private static StringBuilder getAll; public static StringBuilder errorLog = new StringBuilder(); + public static void getFFmpegPath() { + + if (System.getProperty("os.name").contains("Windows")) + { + PathToFFMPEG = PathToFFMPEG.substring(1,PathToFFMPEG.length()-1); + PathToFFMPEG = PathToFFMPEG.substring(0,(int) (PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; + } + else + { + PathToFFMPEG = PathToFFMPEG.substring(0,PathToFFMPEG.length()-1); + PathToFFMPEG = PathToFFMPEG.substring(0,(int) (PathToFFMPEG.lastIndexOf("/"))).replace("%20", "\\ ") + "/Library/ffmpeg"; + } + + if (Settings.btnCustomFFmpegPath.isSelected() && Settings.txtCustomFFmpegPath.getText().equals("") == false) + { + PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); + } + } + public static void run(String cmd) { time = 0; @@ -207,27 +227,27 @@ public void run() { String pipe = ""; if (cmd.contains("pipe:1")) { - pipe = " | " + '"' + VideoPlayer.PathToFFMPEG + '"' + " -strict -2 -v quiet -i pipe:0 -an -c:v bmp -f image2pipe -"; + pipe = " | " + '"' + PathToFFMPEG + '"' + " -strict -2 -v quiet -i pipe:0 -an -c:v bmp -f image2pipe -"; } - VideoPlayer.PathToFFMPEG = "Library\\ffmpeg.exe"; - process = Runtime.getRuntime().exec(new String[]{"cmd.exe" , "/c", VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG) + pipe}); + PathToFFMPEG = "Library\\ffmpeg.exe"; + process = Runtime.getRuntime().exec(new String[]{"cmd.exe" , "/c", PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG) + pipe}); //Back to default if (Settings.btnCustomFFmpegPath.isSelected() && Settings.txtCustomFFmpegPath.getText().equals("") == false) { - VideoPlayer.PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); + PathToFFMPEG = Settings.txtCustomFFmpegPath.getText(); } else { - VideoPlayer.PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(1,VideoPlayer.PathToFFMPEG.length()-1); - VideoPlayer.PathToFFMPEG = VideoPlayer.PathToFFMPEG.substring(0,(int) (VideoPlayer.PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; + PathToFFMPEG = Shutter.class.getProtectionDomain().getCodeSource().getLocation().getPath(); + PathToFFMPEG = PathToFFMPEG.substring(1,PathToFFMPEG.length()-1); + PathToFFMPEG = PathToFFMPEG.substring(0,(int) (PathToFFMPEG.lastIndexOf("/"))).replace("%20", " ") + "\\Library\\ffmpeg.exe"; } } else //Allow to suspend FFmpeg process { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", '"' + VideoPlayer.PathToFFMPEG + '"')); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", '"' + PathToFFMPEG + '"')); process = processFFMPEG.start(); } } @@ -236,10 +256,10 @@ public void run() { String pipe = ""; if (cmd.contains("pipe:1")) { - pipe = " | " + VideoPlayer.PathToFFMPEG + " -strict -2 -v quiet -i pipe:0 -an -c:v bmp -f image2pipe -"; + pipe = " | " + PathToFFMPEG + " -strict -2 -v quiet -i pipe:0 -an -c:v bmp -f image2pipe -"; } - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG) + pipe); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG) + pipe); process = processFFMPEG.start(); } @@ -611,7 +631,7 @@ else if (inputDeviceIsRunning || RecordInputDevice.frame != null && RecordInputD if (System.getProperty("os.name").contains("Windows")) { //VIDEO STREAM - ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + VideoPlayer.PathToFFMPEG + '"' + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + '"' + VideoPlayer.PathToFFMPEG + '"' + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -"); + ProcessBuilder pbv = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + '"' + PathToFFMPEG + '"' + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -"); process = pbv.start(); //AUDIO STREAM @@ -628,14 +648,14 @@ else if (inputDeviceIsRunning || RecordInputDevice.frame != null && RecordInputD inputFile = new File(inputFile.getParent().replace("\\", "/") + "/" + inputFile.getName().replace(extension, ".txt")); } - ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + VideoPlayer.PathToFFMPEG + '"' + concat + " -v quiet " + InputAndOutput.inPoint + " -i " + '"' + inputFile + '"' + " -vn -c:a pcm_s16le -ar 48k -ac 1 -f wav -"); + ProcessBuilder pba = new ProcessBuilder("cmd.exe" , "/c", '"' + PathToFFMPEG + '"' + concat + " -v quiet " + InputAndOutput.inPoint + " -i " + '"' + inputFile + '"' + " -vn -c:a pcm_s16le -ar 48k -ac 1 -f wav -"); processAudio = pba.start(); } } else { //VIDEO STREAM - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + VideoPlayer.PathToFFMPEG + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -"); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + PathToFFMPEG + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -"); process = processFFMPEG.start(); //AUDIO STREAM @@ -652,12 +672,12 @@ else if (inputDeviceIsRunning || RecordInputDevice.frame != null && RecordInputD inputFile = new File(inputFile.getParent().replace("\\", "/") + "/" + inputFile.getName().replace(extension, ".txt")); } - ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", VideoPlayer.PathToFFMPEG + concat + " -v quiet " + InputAndOutput.inPoint + " -i " + '"' + inputFile + '"' + " -vn -c:a pcm_s16le -ar 48k -ac 1 -f wav -"); + ProcessBuilder pba = new ProcessBuilder("/bin/bash", "-c", PathToFFMPEG + concat + " -v quiet " + InputAndOutput.inPoint + " -i " + '"' + inputFile + '"' + " -vn -c:a pcm_s16le -ar 48k -ac 1 -f wav -"); processAudio = pba.start(); } } - Console.consoleFFPLAY.append(Shutter.language.getProperty("command") + " " + VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + VideoPlayer.PathToFFMPEG + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -" + System.lineSeparator()); + Console.consoleFFPLAY.append(Shutter.language.getProperty("command") + " " + PathToFFMPEG + " -strict -2 -hide_banner -threads " + Settings.txtThreads.getText() + " " + cmd + " | " + PathToFFMPEG + " -v quiet -i pipe:0" + fps + " -c:v bmp -an -f image2pipe -" + System.lineSeparator()); JFrame player = new JFrame(); player.getContentPane().setBackground(new Color(42,42,47)); @@ -938,12 +958,12 @@ public void run() { ProcessBuilder processFFMPEG; if (System.getProperty("os.name").contains("Windows")) { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " -strict -2 -hide_banner " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + " -strict -2 -hide_banner " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } else { - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " -strict -2 -hide_banner " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } @@ -1228,12 +1248,12 @@ public void run() { if (System.getProperty("os.name").contains("Windows")) { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } else { - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } @@ -1279,12 +1299,12 @@ public void run() { ProcessBuilder processFFMPEG; if (System.getProperty("os.name").contains("Windows")) { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } else { - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " " + cmd.replace("PathToFFMPEG", VideoPlayer.PathToFFMPEG)); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " " + cmd.replace("PathToFFMPEG", PathToFFMPEG)); process = processFFMPEG.start(); } @@ -1415,12 +1435,12 @@ public static void playerWaveform(final String cmd) { ProcessBuilder processFFMPEG; if (System.getProperty("os.name").contains("Windows")) { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + cmd + '"'); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + cmd + '"'); waveformProcess = processFFMPEG.start(); } else { - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + cmd); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + cmd); waveformProcess = processFFMPEG.start(); } @@ -1508,12 +1528,12 @@ public static boolean isReadable(File file) { ProcessBuilder processFFMPEG; if (System.getProperty("os.name").contains("Windows")) { - processFFMPEG = new ProcessBuilder('"' + VideoPlayer.PathToFFMPEG + '"' + " -strict -2 -hide_banner -i " + '"' + file + '"' + " -t 5 -f null -" + '"'); + processFFMPEG = new ProcessBuilder('"' + PathToFFMPEG + '"' + " -strict -2 -hide_banner -i " + '"' + file + '"' + " -t 5 -f null -" + '"'); process = processFFMPEG.start(); } else { - processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , VideoPlayer.PathToFFMPEG + " -strict -2 -hide_banner -i " + '"' + file + '"' + " -t 5 -f null -"); + processFFMPEG = new ProcessBuilder("/bin/bash", "-c" , PathToFFMPEG + " -strict -2 -hide_banner -i " + '"' + file + '"' + " -t 5 -f null -"); process = processFFMPEG.start(); }