Open Bug 1371999 Opened 6 years ago Updated 10 months ago

Downscaled videos look extremely bad with pronounced aliasing artifacts

Categories

(Core :: Graphics, defect, P3)

Unspecified
Windows
defect

Tracking

()

UNCONFIRMED
Tracking Status
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: dqeswn, Assigned: sotaro)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [gfx-noted])

Attachments

(5 files)

Title says it all. See attachment for a screenshot of a UHD video downscaled on youtube.
Well, this remained unacknowledged...

By the way I have an Nvidia GPU, in case downscaling quality is dependent on driver/manufacturer.

I remember from testing with progDVB that with EVR only Intel did downscaling properly, on Nvidia and AMD based platforms downscaled images looked horribly aliased.
Blocks: MSE
(In reply to avada from comment #1)
> Well, this remained unacknowledged...

That is because I'm fairly busy. Does this happen by default on YouTube or only when you manually select a resolution higher than what YouTube is selecting for you?
Component: Audio/Video: Playback → Graphics
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #2)
> 
> That is because I'm fairly busy. Does this happen by default on YouTube or
> only when you manually select a resolution higher than what YouTube is
> selecting for you?

The latter. But Youtube is not everything. Many resolutions might not always be available.
Priority: -- → P3
Whiteboard: [gfx-noted]

Aliasing is noticeable with a 4K video on Firefox when not fullscreen on my 1080p display in YouTube's 720p viewport.

It should be noted that I've found the same issue even if I use Ctrl+O to play a 4K video (zoomed out to 30% to reduce the size of the video), so it's probably not YouTube related, but how Firefox displays videos. Edge and Chrome downscale correctly in when using their Ctrl+O shortcut to open the same video.

I'm using Firefox 100.0.1, on a desktop with an Nvidia RTX 2060, Intel i5 10400F, and Windows 11. I've also replicated this issue on a laptop with an AMD Ryzen 5 4600H, GTX 1650 Ti and Windows 11, also with Firefox 100.0.1. Both were tested with all default settings and no addons. Hope this helps.

The aliasing issue persists even when using Firefox's built in video player to play the same 4K video. This screenshot was taken by using Windows' split screen window function, which made the scaling issues more prominent.

I wanted to add to this since I actually moved to Firefox for this specific feature, or I guess bug in this case. The lack of scaling made videos look better, at least ones that were 1080p or 1440p on my 1080p display.

Chrome appears to use some sort of bilinear-like filter. While it does reducing aliasing, it actually does it so much that the video ends up looking blurry, even if 4K is selected. I switched from Chrome to Firefox solely because Twitch streams and high res YouTube videos on Chrome looked pretty blurry due to their scaling, especially since the video would not be fullscreen due to chat being open on Twitch. Also, I may be remembering this wrong, but Chrome even applied this filter to a fullscreen video that is 1440p or 4K, and frankly it looked worse than a 1080p video on Firefox.

So I will say: If this bug is fixed so there is some scaling filter for video content, that it at least be one like Bicubic or Lanczos that provide improved sharpening. Or even better: make it an option so the user can select how they want their content scaled.

See Also: → 1758024

@sotaro, any ideas on why/where this is happening?

Flags: needinfo?(sotaro.ikeda.g)

The video looks (too?) aliased in both Firefox and Chrome on my rx6700xt.

about:support:

HardwareStretching both=0 window-only=0 full-screen-only=2 none=0 error=0
OverlaySupport NV12=Scaling YUV2=None BGRA8=Software RGB10A2=None

TexlGyTrail, can you attach your about:support data to this report, please?

Flags: needinfo?(TexlGyTrail)

Just added my about:support info, clearing needinfo request.

Flags: needinfo?(TexlGyTrail)

(In reply to Kelsey Gilbert [:jgilbert] (previously Jeff) from comment #8)

@sotaro, any ideas on why/where this is happening?

I am going to look into it.

Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)
No longer blocks: gfx-triage

https://www.youtube.com/watch?v=Y5D-4JyG2dA

I could reproduce the problem on my Win PC. With local chromium build, I tested when the problem did not happen with chromium.
With the following, the problem did not happen

  • video overlay with RGB swap chain.

With the followings, the problem happened even with chromium.

  • [1] disabling video overlay and SkiaRenderer::DrawYUVVideoQuad() did video rendering.
  • [2] video overlay with YUV swap chain.

When the video played with chromium, video overlay was changed from YUV swap chain to RGB swap chain. Because fps of video was not high in SwapChainPresenter::GetSwapChainFormat().
https://source.chromium.org/chromium/chromium/src/+/main:ui/gl/swap_chain_presenter.cc;l=334

With gecko, when yuv swap chain is disabled, the problem did not happen with RGB swap chain video overlay on my Win PC.

It seems that video scaling to RGB swap chain with VideoProcessor has better quality than Video scaling to YUV with VideoProcessor.

Depends on: 1780815
Blocks: video-perf
Severity: normal → S3

I noticed this issue on my computer today as well. The video I was watching looked particularly bad in picture in picture. I am able to help provide any info if needed. I am also wondering if there are any updates on when a better video scaler will be added to firefox.

OS: Unspecified → Windows

Brandon Karaca, can you attach about:support to this bug? Thank you.

On Windows, RGB video overlay does better video scaling. Majority of cases, chromium also uses it for video rendering on Windows.

For now, with Firefox release, video overlay is supported only to hardware decoded video with intel gpu.
Video overlay support with non-Intel GPU of Firefox release was stopped by Bug 1787293 for now.

Then Bug 1798242 is going to check if we could enable video overlay without ZeroCopyNV12Texture with non-intel GPUs.
Bug 1753373 is going to enable video overlay for software decoded video if video overlay is already enabled and video frame data supports it.

Flags: needinfo?(micromine2004)

I have attached my about:support info.

Flags: needinfo?(micromine2004)

(In reply to Brandon Karaca from comment #18)

I have attached my about:support info.

Thank you! On release channel, video overlay is not enabled yet on NVIDIA gpus. For now, we expects that video overlay usage improves video scaling quality.

Depends on: 1753373
You need to log in before you can comment on or make changes to this bug.