Commit 8334232a authored by petter's avatar petter

Flexible resolution for mp4 generation and ffmpeg elimination; experiments...

Flexible resolution for mp4 generation and ffmpeg elimination; experiments with invokelater to get rid of blank window when maximising in Linux

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@158 0463f305-d864-43cb-8a47-61cf597d4139
parent 3ab95980
......@@ -548,7 +548,7 @@ public class TTT extends JFrame {
recording));
frame.pack();
frame.setResizable(true);
frame.setClosable(true);
// post processing
TTT ttt = getInstance();
ttt.showTTT();
......@@ -907,7 +907,6 @@ public class TTT extends JFrame {
protected void activateNativeLook() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
this.paintAll(this.getGraphics());
} catch (ClassNotFoundException e) {
......@@ -1553,8 +1552,12 @@ public class TTT extends JFrame {
break;
}
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
getInstance().showTTT();
}
});
}
// MOD TD
/**
......
......@@ -1533,7 +1533,8 @@ public class PostProcessorPanel extends GradientPanel {
int x = Integer.parseInt(mp4WidthString.getText());
if (x==0) x=480;
TTT.userPrefs.putInt("VideoResolution", x);
int y = (int)(x * .75);
int y = (int)(x * recording.prefs.framebufferHeight)/recording.prefs.framebufferWidth;
System.out.println(" creating MP4-Video with resolution "+x+"x"+y);
PodcastCreator.createPodcast(recording, x, y, batch,true);
}
} catch (Exception e) {
......
......@@ -47,7 +47,7 @@ public class PodcastCreator {
private static final int RESOLUTION_WIDTH = 480;
private static final int RESOLUTION_HEIGTH = 320;
private static final String FFMPEG = "ffmpeg";
private static final String FFMPEG = "avconv";
private static final String MP4BOX = "MP4Box";
private static final double FRAMES_PER_SEC = 1;
......@@ -188,9 +188,9 @@ public class PodcastCreator {
if (ShowProgressmonitor && !batch && i < recording.messages.size()) {
progressMonitor.setProgress(i);
}
if(TTT.verbose){
System.out.println(" Message (" + i + "/" + recording.messages.size() + ")");
}
//if(TTT.verbose){
// System.out.println(" Message (" + i + "/" + recording.messages.size() + ")");
//}
//create window movie using ffmpeg
//write scaled window image
ImageIO.write(ImageCreator.getScaledInstance(recording.getGraphicsContext().getScreenshot(), resolutionWidth, resolutionHeight, RenderingHints.VALUE_INTERPOLATION_BICUBIC, true), "png", windowImageFile);
......@@ -200,8 +200,8 @@ public class PodcastCreator {
ffmpegCmd,
"-loop", "1",
"-r", String.valueOf(framesPerSec),
"-i", windowImageFile.getPath().replace(" ", "\\ "),
"-pix_fmt", "rgb24",
"-i", windowImageFile.getPath().replace(" ", "\\ "),
"-vcodec", "mpeg4",
"-vframes", String.valueOf(vFrames),
"-s", resolutionWidth + "x" + resolutionHeight,
......@@ -295,9 +295,9 @@ public class PodcastCreator {
scanner.useDelimiter("[ ]+");
if (scanner.findInLine("frame=") != null && scanner.hasNextInt()){
int i = scanner.nextInt();
if(TTT.verbose){
System.out.println(" Frame (" + i + "/" + nFrames + ")");
}
//if(TTT.verbose){
// System.out.println(" Frame (" + i + "/" + nFrames + ")");
//}
if(ShowProgressmonitor){
progressMonitor.setProgress(i);}
}
......@@ -309,7 +309,7 @@ public class PodcastCreator {
exec.createListenerStream();
outMovieFile = recording.getFileBySuffix("mp4");
String[] line = new String[] {
"avconv",
ffmpegCmd,
"-i", audioFile.getPath().replace(" ", "\\ "),
"-i", outMovieTmpFile.getPath().replace(" ", "\\ "),
"-strict","experimental",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment