Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DecoderParams Not Working #665

Open
3 of 7 tasks
Yoojs2 opened this issue Jun 22, 2024 · 1 comment
Open
3 of 7 tasks

DecoderParams Not Working #665

Yoojs2 opened this issue Jun 22, 2024 · 1 comment

Comments

@Yoojs2
Copy link

Yoojs2 commented Jun 22, 2024

Issue Categories

  • Bug
  • Feature Request
  • Question
  • Not sure

Version Information

  • NuGet Package 4.4.350
  • Build From Master branch, Commit Enter commit id. Example: 704c482
  • Build from Branch Name, Commit Enter commit id. Example: 704c482

Sample Code

C#

MediaElement.MediaOpening += (sender, e) =>
{
    if (e.Options.VideoStream is StreamInfo videoStream)
    {
        var videoCodec = e.Options.VideoStream?.CodecName ?? "Unknown";
        var audioCodec = e.Options.AudioStream?.CodecName ?? "Unknown";

        e.Options.DecoderParams["colorspace"] = "bt470bg";
        //e.Options.DecoderParams["colorspace"] = "rgb";       
        //e.Options.DecoderParams["color_range"] = "tv";
        
    }
};

As shown in the code above, I am trying to change the color tone of the video using DecoderParams, but there is no change in the color tone.

The Media Element of FFme shows a different color tone compared to other video players.

I found that using VideoFilter, as shown in the code below, produces almost the same color tone as other video players:

C#

e.Options.VideoFilter = "scale=in_color_matrix=bt709:out_color_matrix=bt601";

However, to utilize FFme's fast frame seeking feature, I need a different method for adjusting the color tone rather than using post-processing.

I believe using DecoderParams might work, but despite trying all the options from the official FFmpeg documentation, there is no change in color tone.

Options I tried:

colorspace

‘rgb’ sRGB
‘bt709’ bt709
‘bt470bg’ bt601
‘smpte170m’ smpte170
‘smpte240m’ smpte240
‘bt2020_ncl’ bt2020

Is there something wrong with how I am using DecoderParams?
Additionally, if there is another way to adjust the color range by setting options before decoding, please let me know.

I look forward to your response.

Thank you.

@mariodivece
Copy link
Member

Could you post an ffplay command-line that correctly passes these decoder parameters and gives the expected result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants