From 83e32b9e665c118aa353164272685f3b67737f1a Mon Sep 17 00:00:00 2001 From: Pacifico Paul <46673657+paulpacifico@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:41:59 +0400 Subject: [PATCH] Add files via upload --- src/library/FFPROBE.java | 33 +++++++++------------------------ src/settings/FunctionUtils.java | 24 +++++++++++++++++++++--- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/library/FFPROBE.java b/src/library/FFPROBE.java index 223e48b5..d70ae528 100644 --- a/src/library/FFPROBE.java +++ b/src/library/FFPROBE.java @@ -299,20 +299,11 @@ else if (line.contains("bottom first") || line.contains("bottom coded first")) } // Détection YUVJ - if ((line.contains("Video:") || line.contains("Stream group")) && line.contains("attached pic") == false) + if (line.contains("Video:") && line.contains("attached pic") == false) { //Codec vidéo - String[] splitVideo = null; - - if (line.contains("Video:") && extension.equals(".heic") == false) - { - splitVideo = line.substring(line.indexOf("Video:")).split(" "); - } - else if (line.contains("Stream group")) //HEIC format - { - splitVideo = line.substring(line.indexOf("Grid:")).split(" "); - } - + String[] splitVideo = line.substring(line.indexOf("Video:")).split(" "); + videoCodec = splitVideo[1].replace(",", ""); if (videoCodec.equals("dnxhd") && line.toLowerCase().contains("dnxhr")) @@ -335,16 +326,8 @@ else if (line.contains("(pc)")) lumaLevel = "0-255"; // Lecture - String data = line; - - if (line.contains("Video:") && extension.equals(".heic") == false) - { - data = line.substring(data.indexOf("Video:")); - } - else if (line.contains("Stream group")) //HEIC format - { - data = line.substring(data.indexOf("Grid:")); - } + String data = line; + data = line.substring(data.indexOf("Video:")); // Timecode Size String split[] = data.split(","); @@ -573,8 +556,10 @@ else if (line.contains("7.1")) subtitleStreams ++; String s[] = line.substring(line.lastIndexOf(":") + 1).split(" "); - subtitlesCodec = s[1].replace(",", ""); } + subtitlesCodec = s[1].replace(",", ""); + } + /* //Timecode from XML if (line.contains("StartTimecode")) { @@ -586,7 +571,7 @@ else if (line.contains("7.1")) timecode2 = str[1].replace(" ", ""); timecode3 = str[2].replace(" ", ""); timecode4 = str[3].replace(" ", ""); - } + }*/ //Timecode if (line.contains("timecode") && line.contains("timecode is invalid") == false && line.contains("Input") == false) //Avoid "timecode" in the filename diff --git a/src/settings/FunctionUtils.java b/src/settings/FunctionUtils.java index c3171d00..e47ac9ab 100644 --- a/src/settings/FunctionUtils.java +++ b/src/settings/FunctionUtils.java @@ -595,13 +595,26 @@ public static String setOutputDestination(String output, File file) { if (caseCreateTree.isSelected()) { File pathToFile = null; + String folderLevel = ""; + if (System.getProperty("os.name").contains("Mac") || System.getProperty("os.name").contains("Linux")) { - String s[] = file.getParent().toString().split("/"); - pathToFile = new File(lblDestination1.getText() + file.getParent().toString().replace("/Volumes", "").replace(s[2], "")); + String s[] = file.getParent().toString().replace("/Volumes", "").split("/"); + for (int i = comboCreateTree.getSelectedIndex() + 1 ; i < s.length ; i++) + { + folderLevel += ("/" + s[i]); + } } else - pathToFile = new File (lblDestination1.getText() + file.getParent().toString().substring(2)); + { + String s[] = file.getParent().toString().substring(2).split("\\\\"); + for (int i = comboCreateTree.getSelectedIndex() + 1 ; i < s.length ; i++) + { + folderLevel += ("\\" + s[i]); + } + } + + pathToFile = new File(lblDestination1.getText() + folderLevel); if (pathToFile.exists() == false) pathToFile.mkdirs(); @@ -864,6 +877,11 @@ else if (suffix.contains("{fps}")) suffix = suffix.replace("{preset}", Utils.currentPreset.replace(".enc", "")); } + if (suffix.contains("{timecode}")) + { + suffix = suffix.replace("{timecode}", FFPROBE.timecode1 + FFPROBE.timecode2 + FFPROBE.timecode3 + FFPROBE.timecode4); + } + if (suffix.contains("{bitrate}")) { if (Shutter.grpBitrate.isVisible())