Added restriction for Encoding Presets with the yuv420 setting (width and height have to be even numbers)
This commit is contained in:
@@ -393,6 +393,7 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
} else {
|
||||
commandInput.textboxKeyTyped(typedChar, keyCode);
|
||||
ffmpegArguments.textboxKeyTyped(typedChar, keyCode);
|
||||
validateInputs();
|
||||
}
|
||||
super.keyTyped(typedChar, keyCode);
|
||||
}
|
||||
@@ -605,6 +606,22 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
|
||||
private void validateInputs() {
|
||||
boolean valid = true;
|
||||
|
||||
boolean isPreset = false;
|
||||
EncodingPreset curPreset = encodingPresetDropdown.getElement(encodingPresetDropdown.getSelectionIndex());
|
||||
if(ffmpegArguments.getText().trim().equals(curPreset.getCommandLineArgs())) {
|
||||
isPreset = true;
|
||||
}
|
||||
|
||||
if(isPreset) {
|
||||
if(curPreset.isYuv420()) {
|
||||
if(getWidthSetting() % 2 != 0 || getHeightSetting() % 2 != 0) {
|
||||
valid = false;
|
||||
renderButton.hoverText = I18n.format("replaymod.gui.rendersettings.customresolution.warning.yuv420");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (rendererDropdown.getElement(rendererDropdown.getSelectionIndex())) {
|
||||
case CUBIC:
|
||||
if (getWidthSetting() * 3 / 4 != getHeightSetting()
|
||||
|
||||
@@ -38,6 +38,8 @@ public enum EncodingPreset implements GuiEntryListEntry {
|
||||
return commandLineArgs.contains("%BITRATE%");
|
||||
}
|
||||
|
||||
public boolean isYuv420() { return commandLineArgs.contains("-pix_fmt yuv420p"); }
|
||||
|
||||
@Override
|
||||
public String getDisplayString() {
|
||||
return getI18nName();
|
||||
|
||||
@@ -314,6 +314,7 @@ replaymod.gui.rendersettings.renderer.equirectangular.description=Renders the vi
|
||||
replaymod.gui.rendersettings.customresolution=Video Resolution
|
||||
replaymod.gui.rendersettings.customresolution.warning.cubic=Cubic Rendering requires an aspect ratio of 4:3
|
||||
replaymod.gui.rendersettings.customresolution.warning.equirectangular=Equirectangular Rendering requires an aspect ratio of 2:1
|
||||
replaymod.gui.rendersettings.customresolution.warning.yuv420=For this preset, the width and height values need to be even numbers
|
||||
replaymod.gui.rendersettings.resolution=Video Resolution
|
||||
replaymod.gui.rendersettings.interpolation=Path Interpolation
|
||||
replaymod.gui.rendersettings.forcechunks=Force Render Chunks
|
||||
|
||||
Reference in New Issue
Block a user