aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicknsy <20588554+nicknsy@users.noreply.github.com>2023-02-23 17:58:34 -0800
committerNick <20588554+nicknsy@users.noreply.github.com>2023-06-22 16:19:59 -0700
commit6c649a7e723454e94303d95d178e91b820ba6b50 (patch)
treee1f03979a385c7e758e5218e0cc37ab4c9aadd6b
parent16ea7baad4030074e291159f3b35ebb009872544 (diff)
Options
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs6
-rw-r--r--MediaBrowser.Model/Configuration/TrickplayOptions.cs61
-rw-r--r--MediaBrowser.Model/Configuration/TrickplayScanBehavior.cs18
3 files changed, 84 insertions, 1 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 7f8ec03fa..9b58f83b4 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -853,10 +853,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
filterParam = "-vf \"" + fps + "\"";
}
- else
+ else if (filterParam.IndexOf("\"", StringComparison.Ordinal) != -1)
{
filterParam = filterParam.Insert(filterParam.IndexOf("\"", StringComparison.Ordinal) + 1, fps + ",");
}
+ else
+ {
+ filterParam += fps + ",";
+ }
var targetDirectory = Path.Combine(_configurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(targetDirectory);
diff --git a/MediaBrowser.Model/Configuration/TrickplayOptions.cs b/MediaBrowser.Model/Configuration/TrickplayOptions.cs
new file mode 100644
index 000000000..d527baaa4
--- /dev/null
+++ b/MediaBrowser.Model/Configuration/TrickplayOptions.cs
@@ -0,0 +1,61 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace MediaBrowser.Model.Configuration
+{
+ /// <summary>
+ /// Class TrickplayOptions.
+ /// </summary>
+ public class TrickplayOptions
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether or not to use HW acceleration.
+ /// </summary>
+ public bool EnableHwAcceleration { get; set; } = false;
+
+ /// <summary>
+ /// Gets or sets the behavior used by trickplay provider on library scan/update.
+ /// </summary>
+ public TrickplayScanBehavior ScanBehavior { get; set; } = TrickplayScanBehavior.NonBlocking;
+
+ /// <summary>
+ /// Gets or sets the process priority for the ffmpeg process.
+ /// </summary>
+ public ProcessPriorityClass ProcessPriority { get; set; } = ProcessPriorityClass.BelowNormal;
+
+ /// <summary>
+ /// Gets or sets the interval, in ms, between each new trickplay image.
+ /// </summary>
+ public int Interval { get; set; } = 10000;
+
+ /// <summary>
+ /// Gets or sets the target width resolutions, in px, to generates preview images for.
+ /// </summary>
+ public HashSet<int> WidthResolutions { get; set; } = new HashSet<int> { 320 };
+
+ /// <summary>
+ /// Gets or sets number of tile images to allow in X dimension.
+ /// </summary>
+ public int TileWidth { get; set; } = 10;
+
+ /// <summary>
+ /// Gets or sets number of tile images to allow in Y dimension.
+ /// </summary>
+ public int TileHeight { get; set; } = 10;
+
+ /// <summary>
+ /// Gets or sets the ffmpeg output quality level.
+ /// </summary>
+ public int Qscale { get; set; } = 10;
+
+ /// <summary>
+ /// Gets or sets the jpeg quality to use for image tiles.
+ /// </summary>
+ public int JpegQuality { get; set; } = 90;
+
+ /// <summary>
+ /// Gets or sets the number of threads to be used by ffmpeg.
+ /// </summary>
+ public int ProcessThreads { get; set; } = 0;
+ }
+}
diff --git a/MediaBrowser.Model/Configuration/TrickplayScanBehavior.cs b/MediaBrowser.Model/Configuration/TrickplayScanBehavior.cs
new file mode 100644
index 000000000..799794176
--- /dev/null
+++ b/MediaBrowser.Model/Configuration/TrickplayScanBehavior.cs
@@ -0,0 +1,18 @@
+namespace MediaBrowser.Model.Configuration
+{
+ /// <summary>
+ /// Enum TrickplayScanBehavior.
+ /// </summary>
+ public enum TrickplayScanBehavior
+ {
+ /// <summary>
+ /// Starts generation, only return once complete.
+ /// </summary>
+ Blocking,
+
+ /// <summary>
+ /// Start generation, return immediately.
+ /// </summary>
+ NonBlocking
+ }
+}