Skip to content

Commit 27ca826

Browse files
Totally up to date
Signed-off-by: JayFromProgramming <ajsweene@mtu.edu>
1 parent 390b4a4 commit 27ca826

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

javaFX-resources/com/example/clippyfx/hello-view.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<children>
2323
<AnchorPane fx:id="LoadPane" layoutX="294.0" layoutY="198.0" prefHeight="126.0" prefWidth="267.0">
2424
<children>
25-
<TextField fx:id="VideoURI" layoutX="10.0" layoutY="85.0" prefHeight="26.0" prefWidth="203.0" />
25+
<TextField fx:id="VideoURI" layoutX="10.0" layoutY="85.0" prefHeight="26.0" prefWidth="203.0" promptText="File URL's go here" />
2626
<Button fx:id="goButton" layoutX="217.0" layoutY="85.0" mnemonicParsing="false" onMousePressed="#onMediaLoad" prefHeight="26.0" prefWidth="41.0" text="Go!" />
2727
<Button fx:id="vp9LoadButton" layoutX="10.0" layoutY="50.0" mnemonicParsing="false" onMouseClicked="#loadFile" prefWidth="124.0" text="Advanced File Load" />
2828
<Button fx:id="LoadFileButton" layoutX="150.0" layoutY="50.0" mnemonicParsing="false" onMouseClicked="#openHelp" prefWidth="108.0" text="Help Menu" />
335 Bytes
Binary file not shown.

src/main/java/HelperMethods/VideoChecks.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ private static String printEncoderError(String result) {
116116
String[] errorSplit = result.split("Error");
117117
if (errorSplit.length > 1) {
118118
return " Error" + errorSplit[1];
119-
}else return result;
119+
}else {
120+
return " " + result;
121+
}
122+
}
123+
124+
private static boolean actualError(String result) {
125+
return result.contains("Error") || result.contains("error") || result.contains("unsupported");
120126
}
121127

122128
public static void checkEncoders() {
@@ -127,30 +133,39 @@ public static void checkEncoders() {
127133
System.out.println("Expecting libx264");
128134
System.out.println("Expecting libvpx_vp9");
129135
try {
130-
// System.out.println("Checking for h264_nvenc...");
131136
Process hwaccel = StreamedCommand.runCommand("ffmpeg -i resources/videoResources/enCheck.webm -c:v h264_nvenc -frames 1 -f null NUL");
132137
String result = StreamedCommand.returnErrorString(hwaccel, 2);
133138
if (result.equals("")) {
134139
AVAILABLE_ENCODERS.add(Encoders.h264_nvenc);
135140
System.out.println("Found h264_nvenc");
141+
}else if(!actualError(result)){
142+
System.out.println("Unable to determine if h264_nvenc is available.\nAssuming h264_nvenc is available: "
143+
+ printEncoderError(result));
144+
AVAILABLE_ENCODERS.add(Encoders.h264_nvenc);
136145
} else {
137146
System.out.println("Failed to find h264_nvenc:" + printEncoderError(result));
138147
}
139-
// System.out.println("Checking for h264_amf...");
140148
hwaccel = StreamedCommand.runCommand("ffmpeg -i resources/videoResources/enCheck.webm -c:v h264_amf -frames 1 -f null NUL");
141149
result = StreamedCommand.returnErrorString(hwaccel, 2);
142150
if (result.equals("")) {
143151
AVAILABLE_ENCODERS.add(Encoders.h264_amf);
144152
System.out.println("Found h264_amf");
153+
} else if(!actualError(result)){
154+
System.out.println("Unable to determine if h264_amf is available.\nAssuming h264_amf is available: "
155+
+ printEncoderError(result));
156+
AVAILABLE_ENCODERS.add(Encoders.h264_amf);
145157
} else {
146158
System.out.println("Failed to find h264_amf:" + printEncoderError(result));
147159
}
148-
// System.out.println("Checking for h264_qsv...");
149160
hwaccel = StreamedCommand.runCommand("ffmpeg -i resources/videoResources/enCheck.webm -c:v h264_qsv -frames 1 -f null NUL");
150161
result = StreamedCommand.returnErrorString(hwaccel, 2);
151162
if (result.equals("")) {
152163
AVAILABLE_ENCODERS.add(Encoders.h264_qsv);
153164
System.out.println("Found h264_qsv");
165+
} else if(!actualError(result)){
166+
System.out.println("Unable to determine if h264_qsv is available.\nAssuming h264_qsv is available\n"
167+
+ printEncoderError(result));
168+
AVAILABLE_ENCODERS.add(Encoders.h264_qsv);
154169
} else {
155170
System.out.println("Failed to find h264_qsv:" + printEncoderError(result));
156171
}

src/main/java/com/example/clippyfx/HelloApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class HelloApplication extends Application {
2020

2121
@Override
2222
public void start(Stage stage) throws IOException, InterruptedException {
23+
int num = 02635;
24+
System.out.println(num);
2325
String check = StreamedCommand.getCommandOutput("ffmpeg -version");
2426
if (check.contains("ffmpeg version")) {
2527
System.out.println("FFmpeg is installed");

0 commit comments

Comments
 (0)