Fixed BT470M color transfer not working

This commit is contained in:
n00mkrad
2021-07-25 23:22:54 +02:00
parent b95fe6dc0d
commit feafd57eda
5 changed files with 9 additions and 7 deletions

View File

@@ -75,8 +75,7 @@ namespace Flowframes.Data
}
else
{
Logger.Log($"Warning: Using 'gamma28' instead of '{colorTransfer.Trim()}'.", true, false, "ffmpeg");
colorTransfer = colorTransfer.Replace("bt470bg", "gamma28"); // https://forum.videohelp.com/threads/394596-Color-Matrix
colorTransfer = colorTransfer.Replace("bt470bg", "gamma28").Replace("bt470m", "gamma28"); // https://forum.videohelp.com/threads/394596-Color-Matrix
}
if (!validColorSpaces.Contains(colorPrimaries.Trim()))

View File

@@ -17,6 +17,8 @@ using Flowframes.MiscUtils;
using System.Threading.Tasks;
using System.Linq;
#pragma warning disable IDE1006
namespace Flowframes
{
public partial class Form1 : Form

View File

@@ -7,6 +7,8 @@ using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
#pragma warning disable IDE1006
namespace Flowframes.Forms
{
public partial class SettingsForm : Form
@@ -195,9 +197,8 @@ namespace Flowframes.Forms
private void tempDirBrowseBtn_Click(object sender, EventArgs e)
{
CommonOpenFileDialog dialog = new CommonOpenFileDialog();
dialog.InitialDirectory = tempDirCustom.Text.Trim();
dialog.IsFolderPicker = true;
CommonOpenFileDialog dialog = new CommonOpenFileDialog { InitialDirectory = tempDirCustom.Text.Trim(), IsFolderPicker = true };
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
tempDirCustom.Text = dialog.FileName;

View File

@@ -39,7 +39,7 @@ namespace Flowframes.Media
if (resampleFps.GetFloat() >= 0.1f)
filters.Add($"fps=fps={resampleFps}");
if (extraData.HasAllValues())
if (Config.GetBool(Config.Key.keepColorSpace) && extraData.HasAllValues())
{
Logger.Log($"Applying color transfer ({extraData.colorSpace}).", true, false, "ffmpeg");
filters.Add($"scale=out_color_matrix={extraData.colorSpace}");

View File

@@ -199,7 +199,7 @@ namespace Flowframes.OS
while (timeSinceLastOutput.ElapsedMilliseconds < 100) await Task.Delay(50);
output = output.Trim('\r', '\n');
Logger.Log($"Output (after {sw.GetElapsedStr()}): " + output.Replace("\r", " / ").Replace("\n", " / "), true);
Logger.Log($"Output (after {sw.GetElapsedStr()}): {output.Replace("\r", " / ").Replace("\n", " / ").Trunc(250)}", true);
if (onlyLastLine)
output = output.SplitIntoLines().LastOrDefault();