From: yukihane Date: Tue, 2 Aug 2011 07:17:29 +0000 (+0900) Subject: 自動リサイズ X-Git-Tag: rel20110806_ver1.5.0~6^2~2 X-Git-Url: http://git.sourceforge.jp/view?p=coroid%2Finqubus.git;a=commitdiff_plain;h=7013b1f1b01bbf1f3673d208547b5f3c5952ed2b 自動リサイズ --- diff --git a/frontend/bin/MediaInfo.dll b/frontend/bin/MediaInfo.dll new file mode 100644 index 0000000..83ff821 Binary files /dev/null and b/frontend/bin/MediaInfo.dll differ diff --git a/frontend/bin/MediaInfo.exe b/frontend/bin/MediaInfo.exe new file mode 100644 index 0000000..6e48fcf Binary files /dev/null and b/frontend/bin/MediaInfo.exe differ diff --git a/frontend/src/saccubus/MainFrame.java b/frontend/src/saccubus/MainFrame.java index 3b4af1c..41f590a 100644 --- a/frontend/src/saccubus/MainFrame.java +++ b/frontend/src/saccubus/MainFrame.java @@ -846,7 +846,7 @@ public class MainFrame extends JFrame { private JTextField outputOptionField = new JTextField(); private final JLabel avfilterOptionLabel = new JLabel(); private final JTextField avfilterOptionField = new JTextField(); - private final JCheckBox resizeCheckBox = new JCheckBox("次のサイズに収まるようリサイズ"); + private final JCheckBox resizeCheckBox = new JCheckBox("次のサイズに収まるよう縮小(-s)"); private final JLabel resizeWidthLabel = new JLabel("横"); private final JTextField resizeWidthField = new NumberFormattedTextField(); private final JLabel resizeHeightLabel = new JLabel("縦"); diff --git a/frontend/src/saccubus/converter/FfmpegCommand.java b/frontend/src/saccubus/converter/FfmpegCommand.java index b5542ea..6b47594 100644 --- a/frontend/src/saccubus/converter/FfmpegCommand.java +++ b/frontend/src/saccubus/converter/FfmpegCommand.java @@ -17,6 +17,9 @@ import saccubus.converter.profile.FfmpegOption; import saccubus.converter.profile.GeneralSetting; import saccubus.converter.profile.NgSetting; import saccubus.net.TextProgressListener; +import yukihane.mediainfowrapper.Info; +import yukihane.mediainfowrapper.MediaInfo; +import yukihane.mediainfowrapper.Size; import yukihane.swf.Cws2Fws; /** @@ -132,6 +135,14 @@ public class FfmpegCommand extends AbstractCommand { } } + 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 avfilterArgs = getAvfilterOptions(ov, addComment, commPath, addTcomment, tcommPath); if (!avfilterArgs.isEmpty()) { diff --git a/frontend/src/saccubus/properties/MovieSetting.java b/frontend/src/saccubus/properties/MovieSetting.java index e58bd36..5a84c9a 100644 --- a/frontend/src/saccubus/properties/MovieSetting.java +++ b/frontend/src/saccubus/properties/MovieSetting.java @@ -23,7 +23,7 @@ public class MovieSetting { private static final String PROP_RESIZE_WIDTH = "CMD_RESIZE_WIDTH"; private static final String PROP_RESIZE_HEIGHT = "CMD_RESIZE_HEIGHT"; private static final String PROP_ADJUST_RATIO = "CMD_ADJUST_RATIO"; - private static final String PROP_PADDING ="CMD_PADDING"; + private static final String PROP_PADDING = "CMD_PADDING"; private final File ffmpeg; private final File vhook; private final File optionFile; @@ -87,10 +87,10 @@ public class MovieSetting { String out = prop.getProperty(PROP_CMDLINE_OUT, "-f ipod -g 150 -qcomp 0.7 -qmin 20 -qmax 30 -qdiff 4 -subq 6 -me_range 16 -i_qfactor 0.714286"); String avfilter = prop.getProperty(PROP_CMDLINE_AVFILTER, ""); - boolean resize = Boolean.getBoolean(prop.getProperty(PROP_RESIZE,"false")); + boolean resize = Boolean.getBoolean(prop.getProperty(PROP_RESIZE, "false")); String width = prop.getProperty(PROP_RESIZE_WIDTH, "512"); String height = prop.getProperty(PROP_RESIZE_HEIGHT, "384"); - boolean adjust = Boolean.getBoolean(prop.getProperty(PROP_ADJUST_RATIO,"false")); + boolean adjust = Boolean.getBoolean(prop.getProperty(PROP_ADJUST_RATIO, "false")); boolean pad = Boolean.getBoolean(prop.getProperty(PROP_PADDING, "false")); FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter, resize, width, height, adjust, pad);