Commit 0a913ca5 authored by petter's avatar petter
Browse files

Printing ffmpeg cmd line in case of error!

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@141 0463f305-d864-43cb-8a47-61cf597d4139
parent c45a9c00
...@@ -233,7 +233,8 @@ public class PodcastCreator { ...@@ -233,7 +233,8 @@ public class PodcastCreator {
//append the created window movie (windowMovieFile) to the output movie (outMovieFile) using MP4Box //append the created window movie (windowMovieFile) to the output movie (outMovieFile) using MP4Box
//NOTE: appending slideMovieFile to outMovieFile directly via "MP4Box -cat slideMovieFile.getPath() outMovieFile.getPath()" causes renaming problems in some cases. Thus outMovieTmpFile is used //NOTE: appending slideMovieFile to outMovieFile directly via "MP4Box -cat slideMovieFile.getPath() outMovieFile.getPath()" causes renaming problems in some cases. Thus outMovieTmpFile is used
exec.createListenerStream(); exec.createListenerStream();
j = exec.exec(new String[] { MP4BOX, "-cat", windowMovieFile.getPath(), outMovieFile.getPath(), "-out", outMovieTmpFile.getPath()}); String [] line = new String[] { MP4BOX, "-cat", windowMovieFile.getPath(), outMovieFile.getPath(), "-out", outMovieTmpFile.getPath()};
j = exec.exec(line);
if (j != 0 || outMovieTmpFile.length() == 0) { if (j != 0 || outMovieTmpFile.length() == 0) {
//error while appending the slideMovie to the output file //error while appending the slideMovie to the output file
windowMovieFile.delete(); windowMovieFile.delete();
...@@ -241,7 +242,10 @@ public class PodcastCreator { ...@@ -241,7 +242,10 @@ public class PodcastCreator {
outMovieTmpFile.delete(); outMovieTmpFile.delete();
windowImageFile.delete(); windowImageFile.delete();
if(TTT.verbose){ if(TTT.verbose){
System.out.println("Unable join slide movies using MP4Box:"); System.out.println("Unable join slide movies using the command:");
String cmdline="";
for (String s:line) cmdline+=s+" ";
System.out.println(cmdline);
System.out.println(exec.getListenerStream());} System.out.println(exec.getListenerStream());}
throw new IOException("unable join slide movies using MP4Box"); throw new IOException("unable join slide movies using MP4Box");
} }
...@@ -293,15 +297,16 @@ public class PodcastCreator { ...@@ -293,15 +297,16 @@ public class PodcastCreator {
} }
exec.createListenerStream(); exec.createListenerStream();
outMovieFile = recording.getFileBySuffix("mp4"); outMovieFile = recording.getFileBySuffix("mp4");
j = exec.exec(new String[] { String[] line = new String[] {
ffmpegCmd, ffmpegCmd,
"-i", audioFile.getPath().replace(" ", "\\ "), "-i", audioFile.getPath().replace(" ", "\\ "),
"-i", outMovieTmpFile.getPath().replace(" ", "\\ "), "-i", outMovieTmpFile.getPath().replace(" ", "\\ "),
"-b:a", "32k", "-b:a", "32k",
"-b:v", "32k", "-b:v", "32k",
"-y", "-y",
outMovieFile.getPath().replace(" ", "\\ ") outMovieFile.getPath().replace(" ", "\\ ")
}); };
j = exec.exec(line);
outMovieTmpFile.delete(); outMovieTmpFile.delete();
if (!batch) { if (!batch) {
timer.stop(); timer.stop();
...@@ -323,7 +328,10 @@ public class PodcastCreator { ...@@ -323,7 +328,10 @@ public class PodcastCreator {
//error while adding audio stream //error while adding audio stream
outMovieFile.delete(); outMovieFile.delete();
if(TTT.verbose){ if(TTT.verbose){
System.out.println("Unable add audio stream using ffmpeg:"); System.out.println("Unable add audio stream using the command:");
String cmdline="";
for (String s:line) cmdline+=s+" ";
System.out.println(cmdline);
System.out.println(exec.getListenerStream()); System.out.println(exec.getListenerStream());
} }
throw new IOException("unable to add audio stream using ffmpeg"); throw new IOException("unable to add audio stream using ffmpeg");
......
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