mirror of
https://github.com/n00mkrad/flowframes.git
synced 2026-07-12 13:31:56 +02:00
Integrated new stream transfer code with config options
This commit is contained in:
@@ -209,7 +209,10 @@ namespace Flowframes.Main
|
||||
|
||||
public static async Task MuxOutputVideo(string inputPath, string outVideo)
|
||||
{
|
||||
bool muxFromInput = true;
|
||||
if (!Config.GetBool("keepAudio") && !Config.GetBool("keepAudio"))
|
||||
return;
|
||||
|
||||
bool muxFromInput = Config.GetInt("audioSubTransferMode") == 0;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Flowframes
|
||||
|
||||
if (canceled) return;
|
||||
|
||||
if (Config.GetBool("keepAudio"))
|
||||
if (Config.GetBool("keepAudio") && Config.GetInt("audioSubTransferMode") == 1)
|
||||
{
|
||||
Program.mainForm.SetStatus("Extracting audio from video...");
|
||||
await FfmpegAudioAndMetadata.ExtractAudioTracks(inPath, current.tempFolder);
|
||||
@@ -115,7 +115,7 @@ namespace Flowframes
|
||||
|
||||
if (canceled) return;
|
||||
|
||||
if (Config.GetBool("keepSubs"))
|
||||
if (Config.GetBool("keepSubs") && Config.GetInt("audioSubTransferMode") == 1)
|
||||
{
|
||||
Program.mainForm.SetStatus("Extracting subtitles from video...");
|
||||
await FfmpegAudioAndMetadata.ExtractSubtitles(inPath, current.tempFolder, current.outMode);
|
||||
|
||||
@@ -185,6 +185,12 @@ namespace Flowframes.Media
|
||||
bool audioCompat = Utils.ContainerSupportsAllAudioFormats(Interpolate.current.outMode, GetAudioCodecs(interpVideo));
|
||||
string audioArgs = audioCompat ? "" : Utils.GetAudioFallbackArgs(Interpolate.current.outMode);
|
||||
|
||||
if (!Config.GetBool("keepAudio"))
|
||||
audioArgs = "-an";
|
||||
|
||||
if (!Config.GetBool("keepSubs"))
|
||||
subArgs = "-sn";
|
||||
|
||||
// TODO: Check if movflags faststart is needed here!
|
||||
|
||||
if (QuickSettingsTab.trimEnabled)
|
||||
@@ -200,7 +206,7 @@ namespace Flowframes.Media
|
||||
|
||||
IOUtils.TryDeleteIfExists(Path.Combine(tempFolder, otherStreamsName));
|
||||
}
|
||||
else // If trimming is disabled we can pull the streams directly from the input file
|
||||
else // If trimming is disabled we can pull the streams directly from the input file
|
||||
{
|
||||
string args = $"-i {inName} -i {inputVideo.Wrap()} -map 0:v:0 -map 1:a:? -map 1:s:? -c copy {audioArgs} {subArgs} {outName}";
|
||||
await RunFfmpeg(args, tempFolder, LogMode.Hidden);
|
||||
|
||||
Reference in New Issue
Block a user