mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Direct transfer of audio/sub streams from input file
To avoid having to extract the full audio/sub streams to files first.
This commit is contained in:
@@ -180,9 +180,10 @@ namespace Flowframes
|
||||
public static string GetAudioCodec(string path, int streamIndex = -1)
|
||||
{
|
||||
string stream = (streamIndex < 0) ? "a" : $"{streamIndex}";
|
||||
string args = $" -v panic -show_streams -select_streams {stream} -show_entries stream=codec_name {path.Wrap()}";
|
||||
string args = $"-v panic -show_streams -select_streams {stream} -show_entries stream=codec_name {path.Wrap()}";
|
||||
string info = GetFfprobeOutput(args);
|
||||
string[] entries = info.SplitIntoLines();
|
||||
|
||||
foreach (string entry in entries)
|
||||
{
|
||||
if (entry.Contains("codec_name="))
|
||||
@@ -191,6 +192,22 @@ namespace Flowframes
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<string> GetAudioCodecs(string path, int streamIndex = -1)
|
||||
{
|
||||
List<string> codecNames = new List<string>();
|
||||
string args = $"-loglevel panic -select_streams a -show_entries stream=codec_name {path.Wrap()}";
|
||||
string info = GetFfprobeOutput(args);
|
||||
string[] entries = info.SplitIntoLines();
|
||||
|
||||
foreach (string entry in entries)
|
||||
{
|
||||
if (entry.Contains("codec_name="))
|
||||
codecNames.Add(entry.Remove("codec_name=").Trim());
|
||||
}
|
||||
|
||||
return codecNames;
|
||||
}
|
||||
|
||||
public static void DeleteSource(string path)
|
||||
{
|
||||
Logger.Log("[FFCmds] Deleting input file/dir: " + path, true);
|
||||
|
||||
Reference in New Issue
Block a user