* @param output 変換後出力動画.
* @throws IOException 変換失敗.
*/
- public Convert(ConvertProfile profile, File video, File comment, WorkerListener<ConvertResult, ConvertProgress> listener) {
+ public Convert(ConvertProfile profile, File video, File comment,
+ WorkerListener<ConvertResult, ConvertProgress> listener) {
super(listener);
this.profile = profile;
this.videoFile = video;
this.commentFile = comment;
+ logger.log(Level.INFO, "convert video:{0}, comment:{1}", new Object[]{videoFile, commentFile});
}
@Override
if (profile.isCommentOverlay()) {
transformedComment = File.createTempFile("vhk", ".tmp", profile.getTempDir());
final HideCondition hide = profile.getNgSetting();
- publish(new ConvertProgress(PROCESS, "コメントの中間ファイルへの変換中"));
+ publish(new ConvertProgress(PROCESS, -1.0, "コメントの中間ファイルへの変換中"));
ConvertToVideoHook.convert(commentFile, transformedComment, hide.getId(), hide.getWord());
}
checkStop();
- publish(new ConvertProgress(PROCESS, "動画の変換を開始"));
+ publish(new ConvertProgress(PROCESS, -1.0, "動画の変換を開始"));
final int code = convert(transformedComment, outputFile);
if (code != 0) {
throw new IOException("ffmpeg実行失敗: " + outputFile.getPath());
}
- publish(new ConvertProgress(PROCESS, "変換が正常に終了しました。"));
+ publish(new ConvertProgress(PROCESS, 100.0, "変換が正常に終了しました。"));
return new ConvertResult(true, outputFile.getName());
} finally {
if (transformedComment != null && transformedComment.exists()) {
String msg;
while ((msg = ebr.readLine()) != null) {
if (msg.startsWith("frame=")) {
- publish(new ConvertProgress(PROCESS, msg));
+ // TODO パーセンテージ計算、出力
+ publish(new ConvertProgress(PROCESS, 0.0, msg));
} else if (!msg.endsWith("No accelerated colorspace conversion found")) {
logger.log(Level.INFO, msg);
}
sb.append(prof.getFontIndex());
sb.append("|");
sb.append("--show-user:");
- sb.append(prof.getMaxNumOfComment());
+ final int dispNum = (prof.getMaxNumOfComment() < 0) ? 30 : prof.getMaxNumOfComment();
+ sb.append(dispNum);
sb.append("|");
sb.append("--shadow:");
sb.append(prof.getShadowIndex());