}
}
+ final Info info = MediaInfo.getInfo(new File("bin", "MediaInfo"), videoFile);
+ // 4:3 なら1.33, 16:9 なら1.76
+ boolean isHD = ((double)info.getWidth()/(double)info.getHeight() > 1.5);
if (ov.isResize()) {
- final Info info = MediaInfo.getInfo(new File("bin", "MediaInfo"), videoFile);
final Size scaled = (ov.isAdjustRatio()) ? MediaInfo.adjustSize(info, ov.getResizeWidth(), ov.
getResizeHeight()) : new Size(info.getWidth(), info.getHeight());
cmdList.add("-s");
cmdList.add(scaled.getWidth() + "x" + scaled.getHeight());
}
- List<String> avfilterArgs = getAvfilterOptions(ov, addComment, commPath, addTcomment, tcommPath);
+ List<String> avfilterArgs = getAvfilterOptions(ov, addComment, commPath, addTcomment, tcommPath, isHD);
if (!avfilterArgs.isEmpty()) {
cmdList.add("-vfilters");
}
private List<String> getAvfilterOptions(FfmpegOption ov, boolean addComment, String commPath, boolean addTcomment,
- String tcommPath) throws UnsupportedEncodingException {
+ String tcommPath, boolean isHD) throws UnsupportedEncodingException {
final List<String> avfilterArgs = new ArrayList<String>();
final String avfilterOption = ov.getAvfilterOption();
if (StringUtils.isNotBlank(avfilterOption)) {
avfilterArgs.add(avfilterOption);
}
final String vhookArg = (getFfmpeg().isVhookDisabled())
- ? null : getVhookArg(addComment, commPath, addTcomment, tcommPath);
+ ? null : getVhookArg(addComment, commPath, addTcomment, tcommPath, isHD);
if (vhookArg != null) {
avfilterArgs.add(vhookArg);
}
}
private String getVhookArg(boolean addComment, String commPath, boolean addTcomment,
- String tcommPath) throws UnsupportedEncodingException {
+ String tcommPath, boolean isHD) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
sb.append("vhext=");
sb.append(getFfmpeg().getVhook().getPath().replace("\\", "/"));
}
if (getFfmpeg().isCommentOpaque()) {
sb.append("--enable-opaque-comment");
+ sb.append("|");
+ }
+ if(isHD){
+ sb.append("--aspect-mode:1");
+ sb.append("|");
}
return sb.toString();
}