Add alltilla to CONTRIBUTORS.md
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This commit is contained in:
parent
8fea819b51
commit
ce81e2aeab
|
@ -4,6 +4,7 @@
|
||||||
- [97carmine](https://github.com/97carmine)
|
- [97carmine](https://github.com/97carmine)
|
||||||
- [Abbe98](https://github.com/Abbe98)
|
- [Abbe98](https://github.com/Abbe98)
|
||||||
- [agrenott](https://github.com/agrenott)
|
- [agrenott](https://github.com/agrenott)
|
||||||
|
- [alltilla](https://github.com/alltilla)
|
||||||
- [AndreCarvalho](https://github.com/AndreCarvalho)
|
- [AndreCarvalho](https://github.com/AndreCarvalho)
|
||||||
- [anthonylavado](https://github.com/anthonylavado)
|
- [anthonylavado](https://github.com/anthonylavado)
|
||||||
- [Artiume](https://github.com/Artiume)
|
- [Artiume](https://github.com/Artiume)
|
||||||
|
|
|
@ -472,8 +472,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
private async Task ExtractAllTextSubtitles(MediaSourceInfo mediaSource, CancellationToken cancellationToken)
|
private async Task ExtractAllTextSubtitles(MediaSourceInfo mediaSource, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var semaphores = new List<SemaphoreSlim> { };
|
var semaphores = new List<SemaphoreSlim>();
|
||||||
var extractableStreams = new List<MediaStream> { };
|
var extractableStreams = new List<MediaStream>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -521,7 +521,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var inputPath = mediaSource.Path;
|
var inputPath = mediaSource.Path;
|
||||||
var outputPaths = new List<string> { };
|
var outputPaths = new List<string>();
|
||||||
var args = string.Format(
|
var args = string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"-i {0} -copyts",
|
"-i {0} -copyts",
|
||||||
|
@ -531,6 +531,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
{
|
{
|
||||||
var outputPath = GetSubtitleCachePath(mediaSource, subtitleStream.Index, "." + GetTextSubtitleFormat(subtitleStream));
|
var outputPath = GetSubtitleCachePath(mediaSource, subtitleStream.Index, "." + GetTextSubtitleFormat(subtitleStream));
|
||||||
var outputCodec = IsCodecCopyable(subtitleStream.Codec) ? "copy" : "srt";
|
var outputCodec = IsCodecCopyable(subtitleStream.Codec) ? "copy" : "srt";
|
||||||
|
var streamIndex = EncodingHelper.FindIndex(mediaSource.MediaStreams, subtitleStream);
|
||||||
|
|
||||||
|
if (streamIndex == -1)
|
||||||
|
{
|
||||||
|
_logger.LogError("Cannot find subtitle stream index for {InputPath} ({Index}), skipping this stream", inputPath, subtitleStream.Index);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath) ?? throw new FileNotFoundException($"Calculated path ({outputPath}) is not valid."));
|
Directory.CreateDirectory(Path.GetDirectoryName(outputPath) ?? throw new FileNotFoundException($"Calculated path ({outputPath}) is not valid."));
|
||||||
|
|
||||||
|
@ -538,7 +545,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
args += string.Format(
|
args += string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
" -map 0:{0} -an -vn -c:s {1} \"{2}\"",
|
" -map 0:{0} -an -vn -c:s {1} \"{2}\"",
|
||||||
subtitleStream.Index,
|
streamIndex,
|
||||||
outputCodec,
|
outputCodec,
|
||||||
outputPath);
|
outputPath);
|
||||||
}
|
}
|
||||||
|
@ -614,9 +621,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
{
|
{
|
||||||
_logger.LogError("ffmpeg subtitle extraction failed for {InputPath} to {OutputPath}", inputPath, outputPath);
|
_logger.LogError("ffmpeg subtitle extraction failed for {InputPath} to {OutputPath}", inputPath, outputPath);
|
||||||
failed = true;
|
failed = true;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (outputPath.EndsWith("ass", StringComparison.OrdinalIgnoreCase))
|
if (outputPath.EndsWith("ass", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
await SetAssFont(outputPath, cancellationToken).ConfigureAwait(false);
|
await SetAssFont(outputPath, cancellationToken).ConfigureAwait(false);
|
||||||
|
@ -625,7 +632,6 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||||
_logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
|
_logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (failed)
|
if (failed)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user