aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-09-07 18:08:41 -0400
committerJoshua M. Boniface <joshua@boniface.me>2024-09-07 18:08:41 -0400
commitc7bb2fe137aea5b819a86eb50bd51f094135c546 (patch)
treef998a91c0a0e00a956bae23a0a77027ed0a445ce /MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
parent5ceedced1c4a8bac5b5b7a5f2bd0913783bd427b (diff)
Backport pull request #12531 from jellyfin/release-10.9.z
Don't apply chapter image settings to music Original-merge: 2fe13f54eaf87eefefd27f4ccb2ace1371f5e886 Merged-by: nielsvanvelzen <nielsvanvelzen@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs18
1 files changed, 14 insertions, 4 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 764230feb..7091d5153 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -598,7 +598,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
try
{
- return await ExtractImageInternal(inputArgument, container, videoStream, imageStreamIndex, threedFormat, offset, true, targetFormat, cancellationToken).ConfigureAwait(false);
+ return await ExtractImageInternal(inputArgument, container, videoStream, imageStreamIndex, threedFormat, offset, true, targetFormat, false, cancellationToken).ConfigureAwait(false);
}
catch (ArgumentException)
{
@@ -610,7 +610,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
}
- return await ExtractImageInternal(inputArgument, container, videoStream, imageStreamIndex, threedFormat, offset, false, targetFormat, cancellationToken).ConfigureAwait(false);
+ return await ExtractImageInternal(inputArgument, container, videoStream, imageStreamIndex, threedFormat, offset, false, targetFormat, isAudio, cancellationToken).ConfigureAwait(false);
}
private string GetImageResolutionParameter()
@@ -636,7 +636,17 @@ namespace MediaBrowser.MediaEncoding.Encoder
return imageResolutionParameter;
}
- private async Task<string> ExtractImageInternal(string inputPath, string container, MediaStream videoStream, int? imageStreamIndex, Video3DFormat? threedFormat, TimeSpan? offset, bool useIFrame, ImageFormat? targetFormat, CancellationToken cancellationToken)
+ private async Task<string> ExtractImageInternal(
+ string inputPath,
+ string container,
+ MediaStream videoStream,
+ int? imageStreamIndex,
+ Video3DFormat? threedFormat,
+ TimeSpan? offset,
+ bool useIFrame,
+ ImageFormat? targetFormat,
+ bool isAudio,
+ CancellationToken cancellationToken)
{
ArgumentException.ThrowIfNullOrEmpty(inputPath);
@@ -701,7 +711,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
var vf = string.Join(',', filters);
var mapArg = imageStreamIndex.HasValue ? (" -map 0:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty;
- var args = string.Format(CultureInfo.InvariantCulture, "-i {0}{3} -threads {4} -v quiet -vframes 1 -vf {2}{5} -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, _threads, GetImageResolutionParameter());
+ var args = string.Format(CultureInfo.InvariantCulture, "-i {0}{3} -threads {4} -v quiet -vframes 1 -vf {2}{5} -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, _threads, isAudio ? string.Empty : GetImageResolutionParameter());
if (offset.HasValue)
{