mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-21 12:59:50 -06:00
removing mov_text from mkv containers as unsupported
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ namespace VideoNodes.Tests
|
||||
public void VideoInfoTest_JudgeDreed()
|
||||
{
|
||||
var vi = new VideoInfoHelper(@"C:\utils\ffmpeg\ffmpeg.exe", new TestLogger());
|
||||
vi.Read(@"D:\videos\unprocessed\Judge Dredd (1995)\Judge Dredd (1995) Bluray-1080p.mkv");
|
||||
vi.Read(@"D:\videos\unprocessed\Hellboy 2019 Bluray-1080p.mp4");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -127,12 +127,19 @@ namespace FileFlows.VideoNodes
|
||||
else
|
||||
ffArgs.Add($"-map 0:{bestAudio!.Index} -c:a copy");
|
||||
|
||||
if (SupportsSubtitles(Extension))
|
||||
if (videoInfo?.SubtitleStreams?.Any() == true)
|
||||
{
|
||||
if (Language != string.Empty)
|
||||
ffArgs.Add($"-map 0:s:m:language:{Language}? -c:s copy");
|
||||
if (SupportsSubtitles(args, videoInfo))
|
||||
{
|
||||
if (Language != string.Empty)
|
||||
ffArgs.Add($"-map 0:s:m:language:{Language}? -c:s copy");
|
||||
else
|
||||
ffArgs.Add($"-map 0:s? -c:s copy");
|
||||
}
|
||||
else
|
||||
ffArgs.Add($"-map 0:s? -c:s copy");
|
||||
{
|
||||
args.Logger?.WLog("Unsupported subtitle for target container, subtitles will be removed.");
|
||||
}
|
||||
}
|
||||
|
||||
string ffArgsLine = string.Join(" ", ffArgs);
|
||||
@@ -166,8 +173,14 @@ namespace FileFlows.VideoNodes
|
||||
}
|
||||
}
|
||||
|
||||
private bool SupportsSubtitles(string container)
|
||||
private bool SupportsSubtitles(NodeParameters args, VideoInfo videoInfo)
|
||||
{
|
||||
if (videoInfo?.SubtitleStreams?.Any() != true)
|
||||
return false;
|
||||
bool mov_text = videoInfo.SubtitleStreams.Any(x => x.Codec == "mov_text");
|
||||
// if mov_text and going to mkv, we can't convert these subtitles
|
||||
if (mov_text && Extension?.ToLower()?.EndsWith("mkv") == true)
|
||||
return false;
|
||||
return true;
|
||||
//if (Regex.IsMatch(container ?? string.Empty, "(mp(e)?(g)?4)|avi|divx|xvid", RegexOptions.IgnoreCase))
|
||||
// return false;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
[
|
||||
{
|
||||
"Name": "BasicNodes",
|
||||
"Version": "0.0.1.29",
|
||||
"Version": "0.0.1.30",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/BasicNodes.zip?raw=true"
|
||||
},
|
||||
{
|
||||
"Name": "MetaNodes",
|
||||
"Version": "0.0.1.29",
|
||||
"Version": "0.0.1.30",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/MetaNodes.zip?raw=true"
|
||||
},
|
||||
{
|
||||
"Name": "VideoNodes",
|
||||
"Version": "0.0.1.29",
|
||||
"Version": "0.0.1.30",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/VideoNodes.zip?raw=true"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user