mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-17 07:36:37 +00:00
Merge pull request #9254 from Shadowghost/dvdbdfix
This commit is contained in:
@@ -561,9 +561,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string GetInputPathArgument(EncodingJobInfo state)
|
||||
{
|
||||
var mediaPath = state.MediaPath ?? string.Empty;
|
||||
|
||||
return _mediaEncoder.GetInputArgument(mediaPath, state.MediaSource);
|
||||
return state.MediaSource.VideoType switch
|
||||
{
|
||||
VideoType.Dvd => _mediaEncoder.GetInputArgument(_mediaEncoder.GetPrimaryPlaylistVobFiles(state.MediaPath, null).ToList(), state.MediaSource),
|
||||
VideoType.BluRay => _mediaEncoder.GetInputArgument(_mediaEncoder.GetPrimaryPlaylistM2tsFiles(state.MediaPath).ToList(), state.MediaSource),
|
||||
_ => _mediaEncoder.GetInputArgument(state.MediaPath, state.MediaSource)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -991,8 +994,18 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
arg.Append(canvasArgs);
|
||||
}
|
||||
|
||||
arg.Append(" -i ")
|
||||
.Append(GetInputPathArgument(state));
|
||||
if (state.MediaSource.VideoType == VideoType.Dvd || state.MediaSource.VideoType == VideoType.BluRay)
|
||||
{
|
||||
var tmpConcatPath = Path.Join(options.TranscodingTempPath, state.MediaSource.Id + ".concat");
|
||||
_mediaEncoder.GenerateConcatConfig(state.MediaSource, tmpConcatPath);
|
||||
arg.Append(" -f concat -safe 0 -i ")
|
||||
.Append(tmpConcatPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
arg.Append(" -i ")
|
||||
.Append(GetInputPathArgument(state));
|
||||
}
|
||||
|
||||
// sub2video for external graphical subtitles
|
||||
if (state.SubtitleStream is not null
|
||||
|
||||
@@ -153,6 +153,14 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the input argument.
|
||||
/// </summary>
|
||||
/// <param name="inputFiles">The input files.</param>
|
||||
/// <param name="mediaSource">The mediaSource.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInputArgument(IReadOnlyList<string> inputFiles, MediaSourceInfo mediaSource);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the input argument for an external subtitle file.
|
||||
/// </summary>
|
||||
@@ -187,5 +195,27 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="pathType">The type of path.</param>
|
||||
void UpdateEncoderPath(string path, string pathType);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary playlist of .vob files.
|
||||
/// </summary>
|
||||
/// <param name="path">The to the .vob files.</param>
|
||||
/// <param name="titleNumber">The title number to start with.</param>
|
||||
/// <returns>A playlist.</returns>
|
||||
IReadOnlyList<string> GetPrimaryPlaylistVobFiles(string path, uint? titleNumber);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary playlist of .m2ts files.
|
||||
/// </summary>
|
||||
/// <param name="path">The to the .m2ts files.</param>
|
||||
/// <returns>A playlist.</returns>
|
||||
IReadOnlyList<string> GetPrimaryPlaylistM2tsFiles(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Generates a FFmpeg concat config for the source.
|
||||
/// </summary>
|
||||
/// <param name="source">The <see cref="MediaSourceInfo"/>.</param>
|
||||
/// <param name="concatFilePath">The path the config should be written to.</param>
|
||||
void GenerateConcatConfig(MediaSourceInfo source, string concatFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user