unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.15k stars 238 forks source link

DecoderParams Not Working #665

Open Yoojs2 opened 3 weeks ago

Yoojs2 commented 3 weeks ago

Issue Categories

Version Information

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 commented 2 weeks ago

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