From b2b387c017ca9982dd748320fa85945c6e6c8d2c Mon Sep 17 00:00:00 2001 From: stax76 Date: Wed, 1 Jun 2022 14:55:04 +0200 Subject: [PATCH] #344 cache and demuxer-max-bytes option added to conf editor --- docs/Changelog.md | 4 +- src/Resources/editor_conf.txt | 169 +++++++++++++++++++--------------- src/WPF/ConfWindow.xaml | 4 +- src/WPF/ConfWindow.xaml.cs | 6 -- 4 files changed, 98 insertions(+), 85 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 7956cec..0cd2f8b 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,6 @@ -- Fix delay loaded external audio and subtitle tracks. +- The options `cache` and `demuxer-max-bytes`have been added + to the conf editor. - Command messages are dispatched with `script-message-to mpvnet`. - New feature to change profile using the command palette. - New show-santa-logo (green and grumpy) option. @@ -9,6 +10,7 @@ script-opts folder does not exist, a script-opts folder is created with defaults for osc and console. - Support mpv idle property, see manual for remarks. +- Fix delay loaded external audio and subtitle tracks. - Fix crash choosing Matroska edition in the menu. - Fix auto-play and auto-load-folder not working with user scripts. - Fix slow startup using osd-scale-by-window=no. diff --git a/src/Resources/editor_conf.txt b/src/Resources/editor_conf.txt index 72c271b..0ae54bf 100644 --- a/src/Resources/editor_conf.txt +++ b/src/Resources/editor_conf.txt @@ -234,7 +234,7 @@ file = mpv filter = Audio type = string url = https://mpv.io/manual/master/#options-audio-device -help = Use the given audio device. This consists of the audio output name, e.g. alsa, followed by /, followed by the audio output specific device name. The default value for this option is auto, which tries every audio output in preference order with the default device.\nAvailable devices can be found in the mpv.net context menu under:\nView > Show Audio Devices +help = Use the given audio device. This consists of the audio output name, e.g. alsa, followed by /, followed by the audio output specific device name. The default value for this option is auto, which tries every audio output in preference order with the default device.\nAvailable devices can be found in the context menu under:\nView > Advanced > Show Audio Devices [setting] name = slang @@ -421,80 +421,6 @@ help = Start with a maximized window. option = yes option = no -[setting] -name = screenshot-directory -file = mpv -width = 500 -type = folder -filter = Screen -help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot. - -[setting] -name = screenshot-format -file = mpv -default = jpg -filter = Screen -help = Set the image file type used for saving screenshots. - -option = jpg -option = png - -[setting] -name = screenshot-tag-colorspace -file = mpv -default = no -filter = Screen -help = Tag screenshots with the appropriate colorspace. Note that not all formats are supported. - -option = yes -option = no - -[setting] -name = screenshot-high-bit-depth -file = mpv -default = yes -filter = Screen -help = If possible, write screenshots with a bit depth similar to the source video. This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used. - -option = yes -option = no - -[setting] -name = screenshot-jpeg-source-chroma -file = mpv -default = yes -filter = Screen -help = Write JPEG files with the same chroma subsampling as the video. If disabled, the libjpeg default is used. - -option = yes -option = no - -[setting] -name = screenshot-template -file = mpv -filter = Screen -type = string -help = Specify the filename template used to save screenshots. The template specifies the filename without file extension, and can contain format specifiers, which will be substituted when taking a screenshot. By default, the template is mpv-shot%n, which results in filenames like mpv-shot0012.png for example.\n\nFind the full documentation here: -url = https://mpv.io/manual/master/#options-screenshot-template - -[setting] -name = screenshot-jpeg-quality -file = mpv -filter = Screen -help = <0-100> Set the JPEG quality level. Higher means better quality. The default is 90. - -[setting] -name = screenshot-png-compression -file = mpv -filter = Screen -help = <0-9> Set the PNG compression level. Higher means better compression. This will affect the file size of the written screenshot file and the time it takes to write a screenshot. Too high compression might occupy enough CPU time to interrupt playback. The default is 7. - -[setting] -name = screenshot-png-filter -file = mpv -filter = Screen -help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default. - [setting] name = taskbar-progress file = mpv @@ -712,3 +638,96 @@ help = Draws the blue mpv.net logo with a santa hat in december, the option is c option = yes option = no + +[setting] +name = screenshot-directory +file = mpv +width = 500 +type = folder +filter = Screenshot +help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot. + +[setting] +name = screenshot-format +file = mpv +default = jpg +filter = Screenshot +help = Set the image file type used for saving screenshots. + +option = jpg +option = png + +[setting] +name = screenshot-tag-colorspace +file = mpv +default = no +filter = Screenshot +help = Tag screenshots with the appropriate colorspace. Note that not all formats are supported. + +option = yes +option = no + +[setting] +name = screenshot-high-bit-depth +file = mpv +default = yes +filter = Screenshot +help = If possible, write screenshots with a bit depth similar to the source video. This is interesting in particular for PNG, as this sometimes triggers writing 16 bit PNGs with huge file sizes. This will also include an unused alpha channel in the resulting files if 16 bit is used. + +option = yes +option = no + +[setting] +name = screenshot-jpeg-source-chroma +file = mpv +default = yes +filter = Screenshot +help = Write JPEG files with the same chroma subsampling as the video. If disabled, the libjpeg default is used. + +option = yes +option = no + +[setting] +name = screenshot-template +file = mpv +filter = Screenshot +type = string +help = Specify the filename template used to save screenshots. The template specifies the filename without file extension, and can contain format specifiers, which will be substituted when taking a screenshot. By default, the template is mpv-shot%n, which results in filenames like mpv-shot0012.png for example.\n\nFind the full documentation here: +url = https://mpv.io/manual/master/#options-screenshot-template + +[setting] +name = screenshot-jpeg-quality +file = mpv +filter = Screenshot +help = <0-100> Set the JPEG quality level. Higher means better quality. The default is 90. + +[setting] +name = screenshot-png-compression +file = mpv +filter = Screenshot +help = <0-9> Set the PNG compression level. Higher means better compression. This will affect the file size of the written screenshot file and the time it takes to write a screenshot. Too high compression might occupy enough CPU time to interrupt playback. The default is 7. + +[setting] +name = screenshot-png-filter +file = mpv +filter = Screenshot +help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default. + +[setting] +name = cache +file = mpv +default = auto +filter = Cache +help = Decide whether to use network cache settings. +url = https://mpv.io/manual/master/#options-cache + +option = yes +option = no +option = auto + +[setting] +name = demuxer-max-bytes +file = mpv +filter = Demuxer +help = Controls how much the demuxer is allowed to buffer ahead.\nSuffixes such as KiB and MiB are supported. +url = https://mpv.io/manual/master/#options-demuxer-max-bytes \ No newline at end of file diff --git a/src/WPF/ConfWindow.xaml b/src/WPF/ConfWindow.xaml index 3fe6a10..5acf2b9 100644 --- a/src/WPF/ConfWindow.xaml +++ b/src/WPF/ConfWindow.xaml @@ -25,7 +25,7 @@ - + @@ -76,10 +76,8 @@ Show mpv.net specific options - Open config folder Preview mpv.conf Show mpv manual - Show support forum \ No newline at end of file diff --git a/src/WPF/ConfWindow.xaml.cs b/src/WPF/ConfWindow.xaml.cs index 13f14ef..64a7005 100644 --- a/src/WPF/ConfWindow.xaml.cs +++ b/src/WPF/ConfWindow.xaml.cs @@ -318,18 +318,12 @@ namespace mpvnet SearchControl.Text = e.AddedItems[0] + ":"; } - void OpenSettingsTextBlock_MouseUp(object sender, MouseButtonEventArgs e) => - ProcessHelp.ShellExecute(Path.GetDirectoryName(Core.ConfPath)); - void PreviewTextBlock_MouseUp(object sender, MouseButtonEventArgs e) => Msg.ShowInfo("mpv.conf Preview" + BR2 + GetContent("mpv")); void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e) => ProcessHelp.ShellExecute("https://mpv.io/manual/master/"); - void SupportTextBlock_MouseUp(object sender, MouseButtonEventArgs e) => - ProcessHelp.ShellExecute("https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#support"); - protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e);