4K upscaled videos lag

I have no trouble smoothly playing videos on a 1080p display, however it lags a lot when using 4K, even if it is just upscaled and videos are not actually 4K in resolution. Is there any way to trick apps into believing that the screen is actually smaller and make them play videos as if they were maximized on only 1080p? I’d rather not ditch my 4K monitor just because videos lag when maximized. I can also just not maximize windows and it will play fine, but then I use only 25% of my screen’s real estate :frowning: and you can imagine it’s not the best viewing experience.

if you use VLC you can try this setting. Otherwise there are no solution, rendering is done using the CPU on Qubes OS, and the larger the display area, the more it uses CPU.

Throwing more cpu to that qube may help.

Are you connecting your 4K display as second display along with 1080p display?
If yes then maybe it’s this issue:

1 Like

Nope, I use a desktop PC with a 4K monitor as my only display. Changing display resolution in dom0’s XFCE to 1080p makes videos no longer lag on maximized windows.

Qubes OS is not able to render 480p without noticeable lags, and you want 4k.

Try mpv, it is better than vlc out of the box. If it does not maange, well, nothing can be done.

For me, VLC is able to play a 1080p movie without issue, the audio only lags behind sometimes about 1/3rd of a second or so. Freetube app is also able to play 1080p Youtube videos without really any problems. I have Purism’s Librem Mini v2 as my PC. They probably carefully tested Qubes with its hardware.

I do not believe it is a case, maybe you do not notice the issue. The link with the provided train and city panning - can you make it full screen and check if there are fluency disruptions (like lags) on city panning scene?
Lags seem to be inevitable in Qubes OS even in 480p for such dynamic scenes due to X11 and Xen software limitations (it’s not CPU/RAM/Hardware problem), it was discussed on github tracker. I hope migration to wayland will fix it someday.

Yes, it lags. In Firefox, it’s noticeable but bearable, while in both VLC and mpv after downloading with yt-dlp, it’s pretty bad. However, I tried watching a movie in 1080p with VLC previously and it was a surprisingly good experience, with not really any noticeable lag for me. Maybe some codecs depend more on GPU acceleration than others?

Thanks for confirmation. Hmm, VLC and mpv were lagging even more? That is strange a bit. Lagging of such video in every resolution in Qubes OS is expected on any hardware, but I thought Firefox+html5 is slower and less effective than VLC/mpv players.

It is not about codes, because better CPU would solve it (but it doesn’t), it is about painting/drawing decoded raw frames in X11 under Xen.
Movies or TV shows do not often have such dynamic long smooth panning that would make us notice these inevitable lags. I watch movies on Qubes OS with not real issues, too, but I am sure lags are there, and playing the same movie on bare GNU+Linux is really much more fluent and smooth, but I just got used to micro-lags of Qubes OS.

I can play 2160p videos in 1080p with no stuttering or lag :thinking: It’s working fine except it’s wasting so much CPU time.

Wouldn’t all that depend on resolution and bitrate? Using a contrieved example: my understanding of video encoding is that a completely monochrome video using a compressed codec could play nice even in 4K because very few changes would need to be decoded and applied between frames (corresponding to a low required bitrate).

Depending on how different videos are encoded, they may be more or less affected by Qubes OS’ CPU rendering limitations at different resolutions if the bitrates are different. What I’m saying is that unless I’m wrong, comparing different videos based on resolution alone is not really meaningful, and that might explain why some folks find everything terrible (presumably trying to watch videos with higher bitrates at a given resolution) and others find things okay even at higher resolutions (presumably watching videos with lower bitrate). Even assuming that their opinions about what is okay and what is not are somewhat consistent.

2 Likes

No, I do not think bitrate or codec matter in this case at all. As I said, you can watch train-city-panning video in 480p and it will lag in Qubes OS.

How can it bitrate of this 480p youtube video be relevant if 1080p video works the same? The bitrate of youtube video a 480p is like 10 times lower.

So, once again, it is NOT about bitrate, not about CPU, not about RAM. It is about Qubes OS not able to refresh the whole screen properly without lags. So, display resolution is more important than video bitrate and etc.

It means that your CPU is enough for decording and bitrate of such videos. It only supports the statement that the existing micro-lags problem is not about decoding performance and bitrate. I am personally certain it is not about CPU performance, nor bitrate.

That would be great.

Hi,
I have this problem too since I bought a 4k monitor.

Now I finally found a way of playing 4k videos from youtube full screen on the 4k monitor with no framedrop at all !

My Hardware

  • CPU : Xeon E5-1650 v4 3.6GHz (6 cores)
  • 64GB RAM
  • Graphic card > Radeon Pro WX 4100
  • 2 Monitors : 1 x 4k +1 x FHD

My way

Not sure if everything is really needed, but this way it works for me.

  1. My untrusted qube is based on debian-13-xfce template
  2. untrusted has access to 6 cores (might not be necessary, mpv uses 300% cpu while playing) and 10GB of RAM (might also work with far less, mpv +Xorg use around 1GB RAM while playing). untrusted is allowed to fullscreen in the qubes settings
  3. Install freetube from https://freetubeapp.io/ (I only use it because it integrates a button to play on external player directly)
  4. Install smplayer : apt install smplayer (but it looks like it uses mpv in the background)
  5. In the freetube settings, configure external Player to smplayer
  6. Open smplayer, go to the settings and change the following :
  • General → Video → output driver → x11
  • I enabled direct rendering Not sure if it really brings something
  • Performance → I checked Allow frame drop (so I can get the statistics of frame dropped with Shift + I)
  • Performance → Threads for decoding : I set to 6 (numbers of cores I have)
  • Network → Youtube → support for video sites = Internal Youtube support
  • Options for youtube : Playback quality = 4K + use adaptive streams + use 60fps if available + allow av1 codec

For some reasons, smplayer only goes real full screen with Alt+F11 and then f
shift + I shows the stats and on my setup it works with 30 fps with no frame drop.

If I choose in the youtube options of smplayer to use mpv instead of Internal Youtube support it is laggy with frame drops. So It might be something there to check

1 Like

I can only watch 1080p YT in web player on 1440p monitor in full screen.
1440p videos are little jagged especially with panning. For 4k there must be super best of my ISP day but still not too smooth.
But downloaded videos I have no issue to play 4k h265 in full screen with MPV.

Display in QubesOS not only relay entirely on CPU but also on memory copying.
I could have 48GB RAM in my laptop but in single channel, for dual channel it’s 32GB only (since 16GB is soldered).

ThinkPad T14 gen3 i5-1245U

Well, in smplayer (also X11 video output) I was having 4k playback without framedrops on not so new hardware (note: direct rendering does not affect anything on Qubes OS to my opinion). But in my case the display resolution was smaller, it can matter.

But we a talking about avoiding only frame drops, not flawless playing. Because Qubes OS is not able to play flawlessly even 1080p video in any player or browser. Everyone can check the panning video on youtube and understand this statement.

This problem happens due to X11/Qubes OS limitations, so nothing can be done at the moment, as I understand.

Yes.
This one I’ve downloaded.
My Pixel 7 is playing it smoothly, my qubesos laptop is not :stuck_out_tongue_winking_eye:

1 Like

When I open a youtube video in firefox, what I get is a lot of frame drop, visible in the “stats for nerds”. Just tried with a random YT 4k video fullscreen, and it has around 70% framedrop. That feels to me like not flawless playing.

Opening the same video within smplayer with x11 output and YT internal support shows under “Display” “Dropped Frames: 0 (decoder) 0 (output)”.

So for me the viewing in smplayer is flawless (which is I guess a subjective feeling). And not flawless is for me was related to framedrop in other players.

I am actually happy with this setup, that’s why I wanted to share it in case it helps someone else, because the other hints on this forum were not working as good as this one for me.

Did you tried this 4k train YT video from beginning of the thread?
MPV is showing 15k frame dropped on (output).