Skip to content

Commit

Permalink
Removing Xuggle. Researching libraries for encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Dakkra committed Aug 28, 2017
1 parent 0710c84 commit fa1c408
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 255 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile 'com.github.wendykierp:JTransforms:3.0'
// Xuggle repo no longer available
compile files('libs/xuggle-xuggler-5.4.jar')
compile files('libs/xuggle-xuggler-noarch-5.4.jar')
//compile files('libs/xuggle-xuggler-5.4.jar')
//compile files('libs/xuggle-xuggler-noarch-5.4.jar')
//Use FFMPEG, replacing xuggle
//compile 'com.github.hoary:javaav:0.5'
compile 'com.googlecode.soundlibs:jlayer:1.0.1-1'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
Expand Down
37 changes: 16 additions & 21 deletions src/main/java/com/soniccandle/controller/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.soniccandle.model.MainModel;
import com.soniccandle.model.RenderSettings;
import com.soniccandle.model.VideoOutputter;
import com.soniccandle.model.XuggleVideoOutputter;
import com.soniccandle.util.ImageFilter;
import com.soniccandle.util.InputFilter;
import com.soniccandle.util.Utils;
Expand Down Expand Up @@ -135,14 +134,6 @@ public void actionPerformed(ActionEvent e) {
return;
}

if (!m.fcOut.getSelectedFile().getName().endsWith(".mp4")
&& (m.outputMethod.getSelectedItem()
.equals(MainView.OUTPUT_MP4_TITLE))) {
File addedMp4 = new File(m.fcOut.getSelectedFile().getParent(),
m.fcOut.getSelectedFile().getName() + ".mp4");
m.fcOut.setSelectedFile(addedMp4);
}

if (m.fcOut.getSelectedFile().exists()
&& !m.fcOut.getSelectedFile().isDirectory()) {
JOptionPane
Expand Down Expand Up @@ -280,15 +271,11 @@ private RenderSettings extractRenderSettings(boolean getOutputter) throws Except
}
}

if (m.outputMethod.getSelectedItem().equals(MainView.OUTPUT_MP4_TITLE)) {
outputter = new XuggleVideoOutputter(m.audioFile, m.outputTo);
} else {
if (!m.outputTo.isDirectory()) {
JOptionPane.showMessageDialog(m.pane, "You must choose an output folder if you want to render an image sequence.");
throw new Exception();
}
outputter = new ImageSeqVideoOutputter(m.audioFile, m.outputTo);
if (!m.outputTo.isDirectory()) {
JOptionPane.showMessageDialog(m.pane, "You must choose an output folder if you want to render an image sequence.");
throw new Exception();
}
outputter = new ImageSeqVideoOutputter(m.audioFile, m.outputTo);
}

rs.audioFile = m.audioFile;
Expand All @@ -298,20 +285,26 @@ private RenderSettings extractRenderSettings(boolean getOutputter) throws Except
rs.width = Main.getVideoWidth();
rs.height = Main.getVideoHeight();

if (getOutputter) {
if (getOutputter)

{
rs.outputter = outputter;
rs.outputter.width = rs.width;
rs.outputter.height = rs.height;
rs.outputter.frameRate = rs.videoFrameRate;
}

if (m.flatColorRb.isSelected()) {
if (m.flatColorRb.isSelected())

{
BufferedImage backgroundImage = new BufferedImage(rs.width, rs.height, BufferedImage.TYPE_INT_ARGB);
Graphics2D backgroundImageG = backgroundImage.createGraphics();
backgroundImageG.setColor(new Color(Integer.parseInt(m.bgColorRed.getText()), Integer.parseInt(m.bgColorGreen.getText()), Integer.parseInt(m.bgColorBlue.getText())));
backgroundImageG.fillRect(0, 0, rs.width, rs.height);
rs.backgroundImage = backgroundImage;
} else if (m.builtInImageRb.isSelected()) {
} else if (m.builtInImageRb.isSelected())

{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
BufferedImage backgroundImage = null;
BufferedImage resizedBackgroundImage = null;
Expand All @@ -337,7 +330,9 @@ private RenderSettings extractRenderSettings(boolean getOutputter) throws Except
}
rs.backgroundImage = resizedBackgroundImage;
g.dispose();
} else if (m.otherImageRb.isSelected()) {
} else if (m.otherImageRb.isSelected())

{
if (m.backgroundImageFile == null) {
JOptionPane.showMessageDialog(m.pane, "You didn't select an image, silly!");
throw new Exception();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.soniccandle.model.MainModel;
import com.soniccandle.model.RenderSettings;
import com.soniccandle.model.VideoOutputter;
import com.soniccandle.model.XuggleVideoOutputter;

public class RenderSwingWorker extends SwingWorker<Boolean, Integer> {

Expand Down Expand Up @@ -53,7 +52,7 @@ protected void process(List<Integer> progresses) {
@Override
public void done() {
c.unlockAfterRender();
if (outputter instanceof XuggleVideoOutputter && outputTo.length() < 100) {
if (outputTo.length() < 100) {
JOptionPane.showMessageDialog(null, "Ooof - looks like there was a problem, sorry. Please check that your audio file is 16-bit wav, not 24 or 32, thanks! Other bitrates coming soon, hopefully.");
return;
}
Expand Down
72 changes: 0 additions & 72 deletions src/main/java/com/soniccandle/model/XuggleVideoOutputter.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/java/com/soniccandle/view/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public class MainView {
public static final String BG_OTHER_IMAGE = "Other Image";
public static final String BG_BUILT_IN_IMAGE = "Built-in Image";
public static final String BG_FLAT_COLOR = "Flat Color";
public static final String OUTPUT_MP4_TITLE = "Mp4 video file";
public static final String OUTPUT_SEQUENCE_TITLE = "Image Sequence (png) (select a folder for output)";

public MainModel m;
Expand Down Expand Up @@ -211,7 +210,7 @@ public void createAndShowGUI() {
inOutC.gridy = 1;
inOutPanel.add(label, inOutC);

String[] outputMethods = {OUTPUT_MP4_TITLE, OUTPUT_SEQUENCE_TITLE};
String[] outputMethods = {OUTPUT_SEQUENCE_TITLE};
m.outputMethod = newSCComboBoxString(outputMethods);
inOutC.weightx = 0.2;
inOutC.gridwidth = 1;
Expand Down
141 changes: 0 additions & 141 deletions src/main/java/com/xuggle/mediatool/demos/MediaConcatenator.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/java/com/soniccandle/model/XuggleTest.java

This file was deleted.

0 comments on commit fa1c408

Please sign in to comment.