Fixed thumbnailing issue...
This commit is contained in:
parent
3a2e2b1cdd
commit
43bbfcc70d
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
function main() {
|
||||
notify-send -u critical "You need to install ffmpegthumbnailer to have FXWinWrap work properly..."
|
||||
xterm -e sudo apt install ffmpegthumbnailer
|
||||
}
|
||||
main;
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
function main() {
|
||||
notify-send -u critical "You need to install ffmpegthumbnailer to have FXWinWrap work properly..."
|
||||
xterm -e sudo apt install ffmpegthumbnailer
|
||||
}
|
||||
main;
|
Binary file not shown.
|
@ -24,7 +24,6 @@ public class Controller {
|
|||
private Process pb; // Process runner
|
||||
private String tmpPath, resolution, xScreenVal, output,
|
||||
startScrpt = System.getProperty("user.dir") + "/resources/bin/StartXWW.sh", // Gets shell that starts stuff local
|
||||
ffmpg = System.getProperty("user.dir") + "/resources/bin/ffmpegthumbnailer", // Gets ffmpeg local
|
||||
textAreaPth = "";
|
||||
private int applyType = 1;
|
||||
private Stage fileChooserStage;
|
||||
|
@ -38,7 +37,7 @@ public class Controller {
|
|||
killBttn, restartBttn, saveBttn;
|
||||
|
||||
// This method is called by the FXMLLoader when initialization is complete
|
||||
@FXML void initialize() {
|
||||
@FXML void initialize() throws Exception {
|
||||
assert clear != null : "fx:id=\"clear\" was not injected: check your FXML file 'Window.fxml'.";
|
||||
assert closeBttn != null : "fx:id=\"closeBttn\" was not injected: check your FXML file 'Window.fxml'.";
|
||||
assert dirLbl != null : "fx:id=\"dirLbl\" was not injected: check your FXML file 'Window.fxml'.";
|
||||
|
@ -53,6 +52,8 @@ public class Controller {
|
|||
assert tilePane != null : "fx:id=\"tilePane\" was not injected: check your FXML file 'Window.fxml'.";
|
||||
assert useXSvrn != null : "fx:id=\"useXSvrn\" was not injected: check your FXML file 'Window.fxml'.";
|
||||
// Initialize your logic here: all @FXML variables will have been injected
|
||||
|
||||
ffmpegChker();
|
||||
}
|
||||
|
||||
// Handler for TextArea[fx:id="dirPathField"] onKeyReleased
|
||||
|
@ -67,6 +68,7 @@ public class Controller {
|
|||
System.out.println("Not calling newDir...");
|
||||
}
|
||||
|
||||
// Scan selected dir
|
||||
public void newDir() {
|
||||
Stage stage = new Stage();
|
||||
if (textAreaPth != "")
|
||||
|
@ -84,12 +86,13 @@ public class Controller {
|
|||
fileList[i].getName().contains(".mpg") || fileList[i].getName().contains(".wmv") ||
|
||||
fileList[i].getName().contains(".mkv") || fileList[i].getName().contains(".flv") ||
|
||||
fileList[i].getName().contains(".webm") || fileList[i].getName().contains(".avi")) {
|
||||
String movieImg = ffmpg + " -w -t='00:30:00' -c png -i " + fileList[i] +
|
||||
" -s 800 -o /tmp/image.png",
|
||||
String movieImg = "ffmpegthumbnailer -w -t='00:30:00' -c png -i " + fileList[i] +
|
||||
" -s 300 -o /tmp/image.png",
|
||||
vExec = "mplayer " + fileList[i];
|
||||
try {
|
||||
pb = Runtime.getRuntime().exec(movieImg);
|
||||
pb.waitFor();
|
||||
System.out.println(movieImg);
|
||||
} catch(Throwable imgIOErr) {
|
||||
System.out.println(imgIOErr);
|
||||
}
|
||||
|
@ -129,7 +132,7 @@ public class Controller {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open image in new window
|
||||
public void displayImg(ImageView imgViewPoped, String title) {
|
||||
Stage popOut = new Stage();
|
||||
Pane pane = new Pane();
|
||||
|
@ -207,12 +210,25 @@ public class Controller {
|
|||
applyType = 2;
|
||||
//VIDEO
|
||||
} else {
|
||||
output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- mplayer -wid WID -nosound -loop 0 " + filePathField.getText();
|
||||
output = "xwinwrap -ov -g " + resolution + " -st -sp -b -nf -s -ni -- mplayer -wid WID -really-quiet -nosound -loop 0 " + filePathField.getText();
|
||||
fileWriter.write(output);
|
||||
applyType = 1;
|
||||
}
|
||||
fileWriter.close();
|
||||
}
|
||||
|
||||
void ffmpegChker() throws Exception {
|
||||
File ffmpgLoc = new File("/usr/bin/ffmpegthumbnailer");
|
||||
boolean exists = ffmpgLoc.exists();
|
||||
System.out.println("" + exists);
|
||||
if (exists) {
|
||||
System.out.println("Ffmpeg is present....");
|
||||
} else {
|
||||
String installer = System.getProperty("user.dir") + "/resources/bin/InstallFFMPEGTHUMB.sh";
|
||||
pb = Runtime.getRuntime().exec(installer);
|
||||
pb.waitFor();
|
||||
}
|
||||
}
|
||||
// Run changes
|
||||
@FXML void applySttngs(ActionEvent event) throws Exception {
|
||||
pb = Runtime.getRuntime().exec("killall xwinwrap &");
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
function main() {
|
||||
notify-send -u critical "You need to install ffmpegthumbnailer to have FXWinWrap work properly..."
|
||||
xterm -e sudo apt install ffmpegthumbnailer
|
||||
}
|
||||
main;
|
Binary file not shown.
Loading…
Reference in New Issue