How to fix this in elementary 5.1 ?
This isn't the sort of problem you fix yourself. You need to report this to the WebKit developers to solve.
First, make sure that you're using the latest version of WebKitGTK, 2.26.2.
Then, report a bug on WebKit Bugzilla. Select the Media component, prefix the title of the bug with [GStreamer], and CC email@example.com. In your bug report, mention the version of WebKitGTK that you're using, and your GStreamer version. Include the screenshot you posted here.
Finally, navigate to webkit://gpu and paste all that information into the bug report. The output you copy/paste will be messy; take the time to add blank lines to make it easier to read.
Lastly, see if you have gstreamer1.0-vaapi installed. If so, uninstall it and check if that makes a difference.