Add support for external audio files

This commit is contained in:
Jonas Resch
2021-11-22 21:47:52 +01:00
parent c677b4f6b7
commit 9978164438
5 changed files with 334 additions and 4 deletions

View File

@@ -678,6 +678,12 @@ namespace MediaBrowser.Controller.MediaEncoding
arg.Append("-i ")
.Append(GetInputPathArgument(state));
if (state.AudioStream.IsExternal)
{
arg.Append(" -i ")
.Append(string.Format(CultureInfo.InvariantCulture, "file:\"{0}\"", state.AudioStream.Path));
}
if (state.SubtitleStream != null
&& state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
&& state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream)
@@ -1999,10 +2005,17 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.AudioStream != null)
{
args += string.Format(
CultureInfo.InvariantCulture,
" -map 0:{0}",
state.AudioStream.Index);
if (state.AudioStream.IsExternal)
{
args += " -map 1:a";
}
else
{
args += string.Format(
CultureInfo.InvariantCulture,
" -map 0:{0}",
state.AudioStream.Index);
}
}
else
{