- FF-1892: FFmpeg Builder Audio Add Track now has ability to set a filter on the new track

This commit is contained in:
John Andrews
2024-11-15 08:52:11 +13:00
parent 2df5ad5071
commit 93db09664e
14 changed files with 41 additions and 3 deletions

View File

@@ -20,7 +20,6 @@ public class FfmpegBuilderAudioAddTrack : TrackSelectorFlowElement<FfmpegBuilder
/// <inheritdoc />
public override int Outputs => 2;
/// <summary>
/// Gets or sets the index to insert this track
/// </summary>
@@ -164,14 +163,19 @@ public class FfmpegBuilderAudioAddTrack : TrackSelectorFlowElement<FfmpegBuilder
[TextVariable(9)]
public string Language { get; set; }
/// <summary>
/// Gets or sets an optional filter for the new track
/// </summary>
[TextVariable(10)]
public string Filter { get; set; }
/// <summary>
/// Gets or sets if the title of the new track should be removed
/// </summary>
[Boolean(10)]
[Boolean(11)]
public bool RemoveTitle { get; set; }
/// <summary>
/// Gets or sets the title of the new track
/// </summary>
[TextVariable(11)]
[TextVariable(12)]
[ConditionEquals(nameof(RemoveTitle), false)]
public string NewTitle { get; set; }
@@ -195,6 +199,7 @@ public class FfmpegBuilderAudioAddTrack : TrackSelectorFlowElement<FfmpegBuilder
args.Logger.WLog("No source audio track found");
return 2;
}
audio.Stream = sourceAudio;
audio.Channels = audio.Stream.Channels;
@@ -207,6 +212,13 @@ public class FfmpegBuilderAudioAddTrack : TrackSelectorFlowElement<FfmpegBuilder
directCopy = true;
}
}
string filter= args.ReplaceVariables(Filter ?? string.Empty, stripMissing: true);
if (string.IsNullOrWhiteSpace(filter) == false)
{
directCopy = false;
args.Logger?.ILog("Filter: " + filter);
audio.Filter = [filter];
}
if (directCopy)
{

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "Der Codec, der für die Audiokodierung verwendet wird.",
"CustomTrackSelection": "Quellspur-Auswahl",
"Filter": "Filter",
"Filter-Help": "Gibt einen benutzerdefinierten Filter an, der auf diese neue Audiospur angewendet wird.",
"Index": "Index",
"Index-Help": "Der Index, an dem die neue Tonspur eingefügt werden soll. Um die neue Audiospur als erste Spur einzufügen, setzen Sie diesen Wert auf 0.",
"Language": "Sprache",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "The codec to use to encode the audio",
"CustomTrackSelection": "Source Track Selection",
"Filter": "Filter",
"Filter-Help": "Specifies a custom filter to apply to this new audio track.",
"Index": "Index",
"Index-Help": "The index where to insert the new audio track. 0 based, so to insert the new audio track as the first track set this to 0.",
"Language": "Language",

View File

@@ -144,6 +144,8 @@
"Codec": "Códec",
"Codec-Help": "El códec a utilizar para codificar el audio",
"CustomTrackSelection": "Selección de Pista de Origen",
"Filter": "Filtro",
"Filter-Help": "Especifica un filtro personalizado para aplicar a esta nueva pista de audio.",
"Index": "Índice",
"Index-Help": "El índice donde insertar la nueva pista de audio. Basado en 0, así que para insertar la nueva pista de audio como la primera pista, establezca esto en 0.",
"Language": "Idioma",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "Le codec à utiliser pour encoder l'audio",
"CustomTrackSelection": "Sélection de Piste Source",
"Filter": "Filtre",
"Filter-Help": "Spécifie un filtre personnalisé à appliquer à cette nouvelle piste audio.",
"Index": "Index",
"Index-Help": "L'index où insérer la nouvelle piste audio. Basé sur 0, donc pour insérer la nouvelle piste audio comme la première piste, réglez ceci sur 0.",
"Language": "Langue",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "Il codec da utilizzare per codificare l'audio",
"CustomTrackSelection": "Selezione traccia sorgente",
"Filter": "Filtro",
"Filter-Help": "Specifica un filtro personalizzato da applicare a questa nuova traccia audio.",
"Index": "Indice",
"Index-Help": "L'indice dove inserire la nuova traccia audio. Basato su 0, quindi per inserire la nuova traccia audio come prima traccia impostare questo a 0.",
"Language": "Lingua",

View File

@@ -144,6 +144,8 @@
"Codec": "コーデック",
"Codec-Help": "オーディオをエンコードするために使用するコーデック",
"CustomTrackSelection": "ソーストラック選択",
"Filter": "フィルター",
"Filter-Help": "この新しいオーディオトラックに適用するカスタムフィルターを指定します。",
"Index": "インデックス",
"Index-Help": "新しいオーディオトラックを挿入するインデックス。0から始まるので、新しいオーディオトラックを最初のトラックとして挿入するには、0に設定します。",
"Language": "言語",

View File

@@ -144,6 +144,8 @@
"Codec": "코덱",
"Codec-Help": "오디오 인코딩에 사용할 코덱",
"CustomTrackSelection": "소스 트랙 선택",
"Filter": "필터",
"Filter-Help": "이 새로운 오디오 트랙에 적용할 사용자 정의 필터를 지정합니다.",
"Index": "인덱스",
"Index-Help": "새 오디오 트랙을 삽입할 인덱스입니다. 0 기반이므로, 새 오디오 트랙을 첫 번째 트랙으로 삽입하려면 0으로 설정합니다.",
"Language": "언어",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "De codec die moet worden gebruikt om de audio te coderen",
"CustomTrackSelection": "Bron Track Selectie",
"Filter": "Filter",
"Filter-Help": "Geeft een aangepast filter op om toe te passen op dit nieuwe audiotrack.",
"Index": "Index",
"Index-Help": "De index waar de nieuwe audiotrack moet worden ingevoegd. 0-gebaseerd, dus om de nieuwe audiotrack als de eerste track in te voegen, stelt u dit in op 0.",
"Language": "Taal",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "O codec a ser utilizado para codificar o áudio",
"CustomTrackSelection": "Seleção de Faixa de Origem",
"Filter": "Filtro",
"Filter-Help": "Especifica um filtro personalizado para aplicar a esta nova faixa de áudio.",
"Index": "Índice",
"Index-Help": "O índice onde inserir a nova faixa de áudio. Baseado em 0, portanto, para inserir a nova faixa de áudio como a primeira faixa, defina isso como 0.",
"Language": "Idioma",

View File

@@ -144,6 +144,8 @@
"Codec": "Кодек",
"Codec-Help": "Кодек для кодирования аудио",
"CustomTrackSelection": "Выбор исходного трека",
"Filter": "Фильтр",
"Filter-Help": "Указывает пользовательский фильтр для применения к этой новой аудиодорожке.",
"Index": "Индекс",
"Index-Help": "Индекс, по которому нужно вставить новый аудиотрек. Начинается с 0, поэтому, чтобы вставить новый аудиотрек как первый, установите это значение в 0.",
"Language": "Язык",

View File

@@ -144,6 +144,8 @@
"Codec": "Codec",
"Codec-Help": "Den codec som ska användas för att koda ljudet",
"CustomTrackSelection": "Källspårval",
"Filter": "Filter",
"Filter-Help": "Anger ett anpassat filter att tillämpa på detta nya ljudspår.",
"Index": "Index",
"Index-Help": "Index där det nya ljudspåret ska infogas. 0-baserat, så för att infoga det nya ljudspåret som det första spåret, sätt detta till 0.",
"Language": "Språk",

View File

@@ -144,6 +144,8 @@
"Codec": "编码器",
"Codec-Help": "用于编码音频的编码器",
"CustomTrackSelection": "源轨道选择",
"Filter": "过滤器",
"Filter-Help": "指定要应用于此新音轨的自定义过滤器。",
"Index": "索引",
"Index-Help": "插入新音频轨道的位置。 基于0所以要将新音频轨道插入为第一轨道请将其设置为0。",
"Language": "语言",

View File

@@ -144,6 +144,8 @@
"Codec": "編解碼器",
"Codec-Help": "用於編碼音頻的編解碼器",
"CustomTrackSelection": "源音軌選擇",
"Filter": "過濾器",
"Filter-Help": "指定要應用於此新音軌的自訂過濾器。",
"Index": "索引",
"Index-Help": "插入新音軌的位置索引。基於 0因此要將新音軌作為第一個音軌插入請將此設置為 0。",
"Language": "語言",