Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpacifico authored Nov 12, 2024
1 parent 9c8af74 commit 31003cb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/library/FFPROBE.java
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ public static void setFilesize() {
if (grpBitrate.isVisible())
{
int multi = 0;
if (lblAudioMapping.getText().equals("Multi"))
if (lblAudioMapping.getSelectedItem().toString().equals("Multi"))
{
if (comboAudio1.getSelectedIndex() != 16)
multi += 1;
Expand Down
46 changes: 37 additions & 9 deletions src/settings/AudioSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,20 @@ else if (audioCodec.equals("ALAC 24Bits"))

if (FFPROBE.stereo)
{
if (FFPROBE.surround && lblAudioMapping.getText().equals("Multi") == false)
if (FFPROBE.surround && lblAudioMapping.getSelectedItem().toString().equals("Multi") == false)
{
if (audioFiltering != "")
audioFiltering = audioFiltering + ",";

String mono = "";
if (lblAudioMapping.getText().equals(language.getProperty("mono")))
if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("mono")))
{
mono = " -ac 1";
}

audio += " -c:a " + audioCodec + mono + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate + " -filter:a " + '"' + audioFiltering + "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR" + '"' + " -map a?";
}
else if (lblAudioMapping.getText().equals("Multi"))
else if (lblAudioMapping.getSelectedItem().toString().equals("Multi"))
{
String mapping = "";

Expand Down Expand Up @@ -340,7 +340,7 @@ else if (audioFiltering != "")

audio += " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate + audioFiltering + mapping;
}
else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
else if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("mono")))
{
if (audioFiltering != "")
audioFiltering = "," + audioFiltering;
Expand All @@ -362,6 +362,18 @@ else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
audio += "[0:a]channelsplit=channel_layout=stereo:channels=FR" + audioFiltering + "[a]" + '"' + " -ac 1 -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
}
else if (lblAudioMapping.getSelectedItem().toString().equals("Mix"))
{
if (audioFiltering != "")
audioFiltering = "," + audioFiltering;

if (filterComplex != "")
audio += ";";
else
audio += " -filter_complex " + '"';

audio += "[0:a]amix=inputs=" + FFPROBE.channels + audioFiltering + "[a]" + '"' + " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else //Stereo
{
if (audioFiltering != "")
Expand All @@ -382,18 +394,18 @@ else if (FFPROBE.channels > 1)
else
audio += " -filter_complex " + '"';

if (lblAudioMapping.getText().equals(language.getProperty("stereo")))
if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("stereo")))
{
audio += "[0:a][2:a]amix=inputs=2" + audioFiltering + "[a]" + '"' + " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else if (lblAudioMapping.getText().equals("Multi"))
else if (lblAudioMapping.getSelectedItem().toString().equals("Multi"))
{
if (audioFiltering != "")
audioFiltering = " -filter:a " + '"' + audioFiltering + '"';

audio += " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate + audioFiltering + " -map 0:a? -map 2:a?";
}
else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
else if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("mono")))
{
if (comboAudio1.getSelectedIndex() != 16 && comboAudio2.getSelectedIndex() != 16) //Mixdown all tracks to mono
{
Expand All @@ -402,8 +414,12 @@ else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
else
audio += "[" + String.valueOf(comboAudio1.getSelectedIndex()).replace("1","2") + ":a]anull" + audioFiltering + "[a]" + '"' + " -ac 1 -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else if (lblAudioMapping.getSelectedItem().toString().equals("Mix"))
{
audio += "[0:a]amix=inputs=" + FFPROBE.channels + audioFiltering + "[a]" + '"' + " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
}
else if (lblAudioMapping.getText().equals(language.getProperty("stereo")))
else if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("stereo")))
{
if (audioFiltering != "")
audioFiltering = "," + audioFiltering;
Expand All @@ -415,7 +431,7 @@ else if (lblAudioMapping.getText().equals(language.getProperty("stereo")))

audio += "[0:a:" + comboAudio1.getSelectedIndex() + "][0:a:" + comboAudio2.getSelectedIndex() + "]amerge=inputs=2" + audioFiltering + "[a]" + '"' + " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
else if (lblAudioMapping.getSelectedItem().toString().equals(language.getProperty("mono")))
{
if (audioFiltering != "")
audioFiltering = "," + audioFiltering;
Expand All @@ -432,6 +448,18 @@ else if (lblAudioMapping.getText().equals(language.getProperty("mono")))
else
audio += "[0:a:" + comboAudio1.getSelectedIndex() + "]anull" + audioFiltering + "[a]" + '"' + " -ac 1 -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else if (lblAudioMapping.getSelectedItem().toString().equals("Mix"))
{
if (audioFiltering != "")
audioFiltering = "," + audioFiltering;

if (filterComplex != "")
audio += ";";
else
audio += " -filter_complex " + '"';

audio += "[0:a]amix=inputs=" + FFPROBE.channels + audioFiltering + "[a]" + '"' + " -c:a " + audioCodec + " -ar " + lbl48k.getSelectedItem().toString() + audioBitrate;
}
else
{
String mapping = "";
Expand Down
37 changes: 3 additions & 34 deletions src/settings/FunctionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1202,48 +1202,17 @@ public static String setFilterComplex(String filterComplex, String audio, boolea
filterComplex = " -filter_complex " + '"' + filterComplex + "[out]";
else
filterComplex = " -filter_complex " + '"' + "[0:v]" + filterComplex + "[out]";

float newFPS = Float.parseFloat((comboFPS.getSelectedItem().toString()).replace(",", "."));
float value = (float) (newFPS/ FFPROBE.currentFPS);

if (caseConform.isSelected() && (comboConform.getSelectedItem().toString().equals(language.getProperty("conformBySpeed")) || comboConform.getSelectedItem().toString().equals(language.getProperty("conformByReverse"))) && (value < 0.5f || value > 2.0f))
{
filterComplex += '"' + " -map " + '"' + "[out]" + '"' + audio;
}
else if (caseConform.isSelected() && comboConform.getSelectedItem().toString().equals(language.getProperty("conformBySlowMotion")))
{
filterComplex += '"' + " -map " + '"' + "[out]" + '"' + audio;
}
else if (FFPROBE.channels > 1 && (lblAudioMapping.getText().equals(language.getProperty("stereo")) || lblAudioMapping.getText().equals(language.getProperty("mono"))) && (debitAudio.getSelectedItem().toString().equals("0") == false || comboAudioCodec.getSelectedItem().equals("FLAC")) && FFPROBE.stereo == false)
{
filterComplex += audio + " -map " + '"' + "[out]" + '"' + " -map " + '"' + "[a]" + '"';
}
else if (FFPROBE.stereo && lblAudioMapping.getText().equals(language.getProperty("mono")) && (debitAudio.getSelectedItem().toString().equals("0") == false || comboAudioCodec.getSelectedItem().equals("FLAC")) && FFPROBE.surround == false)

if (audio.contains("[a]"))
{
filterComplex += audio + " -map " + '"' + "[out]" + '"' + " -map " + '"' + "[a]" + '"';
}
else
filterComplex += '"' + " -map " + '"' + "[out]" + '"' + audio;

}
else
{
float newFPS = Float.parseFloat((comboFPS.getSelectedItem().toString()).replace(",", "."));
float value = (float) (newFPS/ FFPROBE.currentFPS);

if (caseConform.isSelected() && (comboConform.getSelectedItem().toString().equals(language.getProperty("conformBySpeed")) || comboConform.getSelectedItem().toString().equals(language.getProperty("conformByReverse"))) && (value < 0.5f || value > 2.0f))
{
filterComplex = " -map v:0" + audio;
}
else if (caseConform.isSelected() && comboConform.getSelectedItem().toString().equals(language.getProperty("conformBySlowMotion")))
{
filterComplex = " -map v:0" + audio;
}
else if (FFPROBE.channels > 1 && (lblAudioMapping.getText().equals(language.getProperty("stereo")) || lblAudioMapping.getText().equals(language.getProperty("mono"))) && (debitAudio.getSelectedItem().toString().equals("0") == false || comboAudioCodec.getSelectedItem().equals("FLAC")) && FFPROBE.stereo == false)
{
filterComplex = audio + " -map v:0 -map " + '"' + "[a]" + '"';
}
else if (FFPROBE.stereo && lblAudioMapping.getText().equals(language.getProperty("mono")) && (debitAudio.getSelectedItem().toString().equals("0") == false || comboAudioCodec.getSelectedItem().equals("FLAC")) && FFPROBE.surround == false)
if (audio.contains("[a]"))
{
filterComplex = audio + " -map v:0 -map " + '"' + "[a]" + '"';
}
Expand Down

0 comments on commit 31003cb

Please sign in to comment.