Firefox Hardware Acceleration(AMD)

I followed the instructions for setting up hardware-acceleration on firefox from the arch wiki .

  1. I checked that my libva-mesa-driver was installed.
  2. I checked that my WebRenderer was working in about:support under graphics.
  3. I checked that all the flags were set correctly and tried switching the media.av1.enabled flag but it didn’t have any impact.

After all that I started firefox with:

MOZ_X11_EGL=1 MOZ_LOG="PlatformDecoderModule:5" firefox 2>&1 | grep 'VA-API'

In the output I got:

D/PlatformDecoderModule Initialising VA-API FFmpeg decoder
D/PlatformDecoderModule VA-API FFmpeg init successful
D/PlatformDecoderModule Choosing FFmpeg pixel format for VA-API video decoding.
D/PlatformDecoderModule DMABUF/VA-API Got one frame output with pts=0dts=0 duration=33366 opaque=-9223372036854775808
etc.

Everything looks like it’s working but the video looks like this:

I also tried using h264ify addon for firefox in case the video type wasn’t supported as suggested in the arch wiki. Any help would be much appreciated.
Here is my system configuration:

System:    Kernel: 5.10.14-119-tkg-pds x86_64 bits: 64 compiler: gcc v: 10.2.1 
       parameters: intel_pstate=passive BOOT_IMAGE=/boot/vmlinuz-linux510-tkg-pds 
       root=UUID=b86d9343-d7d3-4c0e-878d-d8d39a6de87d rw radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 
       amdgpu.si_support=1 amdgpu.dc=1 quiet apparmor=1 security=apparmor 
       resume=UUID=7e762033-a483-4ae5-9b8f-d54af4e2a4e9 udev.log_priority=3 
       Desktop: KDE Plasma 5.20.5 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: ASRock model: Z68 Pro3 serial: <filter> UEFI: American Megatrends v: P2.30 date: 03/14/2018 
CPU:       Info: Quad Core model: Intel Core i5-2500K bits: 64 type: MCP arch: Sandy Bridge family: 6 model-id: 2A (42) 
       stepping: 7 microcode: 2F L2 cache: 6 MiB 
       flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 26400 
       Speed: 1656 MHz min/max: 1600/5900 MHz Core speeds (MHz): 1: 1656 2: 1603 3: 1620 4: 1605 
       Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
       Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
       Type: mds mitigation: Clear CPU buffers; SMT disabled 
       Type: meltdown mitigation: PTI 
       Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
       Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
       Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB filling 
       Type: srbds status: Not affected 
       Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics vendor: ASRock driver: i915 v: kernel 
       bus ID: 00:02.0 chip ID: 8086:0112 class ID: 0380 
       Device-2: Advanced Micro Devices [AMD/ATI] Hawaii PRO [Radeon R9 290/390] vendor: Micro-Star MSI driver: amdgpu 
       v: kernel alternate: radeon bus ID: 01:00.0 chip ID: 1002:67b1 class ID: 0300 
       Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: loaded: amdgpu display ID: :0 screens: 1 
       Screen-1: 0 s-res: 2560x1080 s-dpi: 96 s-size: 675x285mm (26.6x11.2") s-diag: 733mm (28.8") 
       Monitor-1: DisplayPort-3 res: 2560x1080 dpi: 81 size: 798x334mm (31.4x13.1") diag: 865mm (34.1") 
       OpenGL: renderer: AMD Radeon R9 390 Series (HAWAII DRM 3.40.0 5.10.14-119-tkg-pds LLVM 11.0.1) 
       v: 4.6 Mesa 20.3.4 direct render: Yes 
Audio:     Device-1: Intel 6 Series/C200 Series Family High Definition Audio vendor: ASRock driver: snd_hda_intel 
       v: kernel bus ID: 00:1b.0 chip ID: 8086:1c20 class ID: 0403 
       Device-2: Advanced Micro Devices [AMD/ATI] Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] 
       vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 1002:aac8 class ID: 0403 
       Sound Server: ALSA v: k5.10.14-119-tkg-pds 
 Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASRock driver: r8169 v: kernel 
       port: d000 bus ID: 05:00.0 chip ID: 10ec:8168 class ID: 0200 
       IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 1.17 TiB used: 288.9 GiB (24.1%) 
       SMART Message: Unable to run smartctl. Root privileges required. 
       ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 850 PRO 256GB size: 238.47 GiB block size: 
       physical: 512 B logical: 512 B speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: 4B6Q scheme: GPT 
       ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD10EALX-009BA0 size: 931.51 GiB block size: 
       physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 1H15 scheme: GPT 
       ID-3: /dev/sdc maj-min: 8:32 type: USB vendor: Generic model: Flash Disk size: 28.91 GiB block size: 
       physical: 512 B logical: 512 B rotation: SSD serial: <filter> rev: 8.07 scheme: MBR 
       SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure? 
Partition: ID-1: / raw size: 237.97 GiB size: 233.24 GiB (98.01%) used: 28.96 GiB (12.4%) fs: ext4 dev: /dev/sda2 
       maj-min: 8:2 
       ID-2: /boot/efi raw size: 513 MiB size: 512 MiB (99.80%) used: 9.1 MiB (1.8%) fs: vfat dev: /dev/sda1 
       maj-min: 8:1 
       ID-3: /home raw size: 915.51 GiB size: 900.14 GiB (98.32%) used: 259.93 GiB (28.9%) fs: ext4 dev: /dev/sdb2 
       maj-min: 8:18 
Swap:      Kernel: swappiness: 10 (default 60) cache pressure: 50 (default 100) 
       ID-1: swap-1 type: partition size: 16 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sdb1 maj-min: 8:17 
Sensors:   System Temperatures: cpu: 37.0 C mobo: N/A gpu: amdgpu temp: 62.0 C 
       Fan Speeds (RPM): N/A gpu: amdgpu fan: 535 
Info:      Processes: 233 Uptime: 6h 35m wakeups: 0 Memory: 15.53 GiB used: 3.82 GiB (24.6%) Init: systemd v: 247 
       Compilers: gcc: 10.2.0 clang: 11.0.1 Packages: pacman: 1605 lib: 439 flatpak: 0 Shell: Bash v: 5.1.0 
       running in: konsole inxi: 3.3.01