Fixed thumbnailing issue...
This commit is contained in:
		
										
											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 Process pb;  // Process runner | ||||||
|     private String tmpPath, resolution, xScreenVal, output, |     private String tmpPath, resolution, xScreenVal, output, | ||||||
|                    startScrpt = System.getProperty("user.dir") + "/resources/bin/StartXWW.sh",  // Gets shell that starts stuff local |                    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 = ""; |                    textAreaPth = ""; | ||||||
|     private int applyType = 1; |     private int applyType = 1; | ||||||
|     private Stage fileChooserStage; |     private Stage fileChooserStage; | ||||||
| @@ -38,7 +37,7 @@ public class Controller { | |||||||
|                          killBttn, restartBttn, saveBttn; |                          killBttn, restartBttn, saveBttn; | ||||||
|  |  | ||||||
|     // This method is called by the FXMLLoader when initialization is complete |     // 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 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 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'."; |         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 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'."; |         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 |         // Initialize your logic here: all @FXML variables will have been injected | ||||||
|  |  | ||||||
|  |         ffmpegChker(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     // Handler for TextArea[fx:id="dirPathField"] onKeyReleased |     // Handler for TextArea[fx:id="dirPathField"] onKeyReleased | ||||||
| @@ -67,6 +68,7 @@ public class Controller { | |||||||
|              System.out.println("Not calling newDir..."); |              System.out.println("Not calling newDir..."); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     // Scan selected dir | ||||||
|     public void newDir() { |     public void newDir() { | ||||||
|         Stage stage = new Stage(); |         Stage stage = new Stage(); | ||||||
|         if (textAreaPth != "") |         if (textAreaPth != "") | ||||||
| @@ -84,12 +86,13 @@ public class Controller { | |||||||
|                 fileList[i].getName().contains(".mpg") || fileList[i].getName().contains(".wmv") || |                 fileList[i].getName().contains(".mpg") || fileList[i].getName().contains(".wmv") || | ||||||
|                 fileList[i].getName().contains(".mkv") || fileList[i].getName().contains(".flv") || |                 fileList[i].getName().contains(".mkv") || fileList[i].getName().contains(".flv") || | ||||||
|                 fileList[i].getName().contains(".webm") || fileList[i].getName().contains(".avi")) { |                 fileList[i].getName().contains(".webm") || fileList[i].getName().contains(".avi")) { | ||||||
|                     String movieImg = ffmpg + " -w -t='00:30:00' -c png -i " + fileList[i] + |                     String movieImg = "ffmpegthumbnailer -w -t='00:30:00' -c png -i " + fileList[i] + | ||||||
|                                                                 " -s 800 -o /tmp/image.png", |                                                                 " -s 300 -o /tmp/image.png", | ||||||
|                            vExec = "mplayer " + fileList[i]; |                            vExec = "mplayer " + fileList[i]; | ||||||
|                     try { |                     try { | ||||||
|                         pb = Runtime.getRuntime().exec(movieImg); |                         pb = Runtime.getRuntime().exec(movieImg); | ||||||
|                         pb.waitFor(); |                         pb.waitFor(); | ||||||
|  |                             System.out.println(movieImg); | ||||||
|                     } catch(Throwable imgIOErr) { |                     } catch(Throwable imgIOErr) { | ||||||
|                             System.out.println(imgIOErr); |                             System.out.println(imgIOErr); | ||||||
|                     } |                     } | ||||||
| @@ -129,7 +132,7 @@ public class Controller { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |     // Open image in new window | ||||||
|     public void displayImg(ImageView imgViewPoped, String title) { |     public void displayImg(ImageView imgViewPoped, String title) { | ||||||
|         Stage popOut = new Stage(); |         Stage popOut = new Stage(); | ||||||
|         Pane pane = new Pane(); |         Pane pane = new Pane(); | ||||||
| @@ -207,12 +210,25 @@ public class Controller { | |||||||
|                 applyType = 2; |                 applyType = 2; | ||||||
|           //VIDEO |           //VIDEO | ||||||
|         } else { |         } 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); |                 fileWriter.write(output); | ||||||
|                 applyType = 1; |                 applyType = 1; | ||||||
|         } |         } | ||||||
|     fileWriter.close(); |     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 |     // Run changes | ||||||
|     @FXML void applySttngs(ActionEvent event) throws Exception { |     @FXML void applySttngs(ActionEvent event) throws Exception { | ||||||
|         pb = Runtime.getRuntime().exec("killall xwinwrap &"); |         pb = Runtime.getRuntime().exec("killall xwinwrap &"); | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								src/versions/v0.0.3/resources/bin/InstallFFMPEGTHUMB.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										8
									
								
								src/versions/v0.0.3/resources/bin/InstallFFMPEGTHUMB.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -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.
										
									
								
							
		Reference in New Issue
	
	Block a user