Improve video playback performance including YouTube (ytfzf)

That was it.

Indeed. Same at my end.

I was under impression that some people like yourself actually got it working and I just need to tweak things out: What is the best way to play blu-ray / BDMV movies? - #13 by balko

Some points to note:

  • Top Gun’s dogfight scene with the same frame size as yours above plays smoothly even with 4k, especially at 0:15 and 1:06
  • There’s definitely something with how Qubes/Xen renders video. I see significant difference between non-Qubes and Qubes versions of these tests:

1 Like

I doubt there is any user PC that will be able to play even 1080p video in Qubes OS smoothly.

Why would you doubt a fact which we already discussed?

So, even 360p lags for you during panning part (from 0m20s)?

Well, I made it tolerable to watch. In fact, I do not notice this issue much. Only when I see the same content played on different OS, the smoothness there is noticeable.

And having modern Intel 11/12 Gen+ CPU helps any way. Not perfect, but watchable.

Can you elaborate, what is the so called “fact”? That youtube 1080p (even 360p) is jumpy even on modern Intel CPUs? Because there are people who do not notice the problem and do not believe the reality. Luckily, @Zeno does see the lack of smoothness themself.

Yes.

1 Like

I downloaded the panning city youtube video in different resolutions and tried to play it on modern CPU with a lot of VCPUs, 16GiB+ RAM in mpv/smplayer/mplayer with different options.

And in all cases the video output lags during panning and other moments.

That’s why I think the issue is in Xen+Xorg interaction. I believe CPU is able to decode the stream on fly for sure.

=> So, the problem probably lies in Xen/Xorg/QubesOS not good video output architecture.

Yes, same here.
I’ve tried to add 6 CPUs and 10 GB of RAM – same result.

Could be related to video specifics/codecs too, perhaps.

I didn’t notice many differences in two blu-rays(~50 GB each) in terms of smoothness on lower frame(~720p) sizes compare to other OS.

Another note: when I make video window much smaller, it increases smoothness, so the problem is with Qubes OS video output, not video decodeing/processing/codecs and etc.

1 Like

Just tested that 4K video with the train and city panning in 1080p (screen resolution) on my NV41 using the solution of this OP and it lags very, very little, mostly during the city scene, but it’s very watchable…and that’s without using performance governor and only 8/12 cores assigned and only 3.5 GB RAM assigned to that VM…sure, if you’re a graphics aficionado then you want exactly zero lags, but in that case QubesOS is simply not the right system for you.

For most people I’d think that the existing performance, if using modern hardware and solutions such as the one presented in this thread, is good enough.

The bad part is that does not matter. You can send all cores to this qube, give it 60 GiB of memory and it still will lag in similar manner, probably even playing this video in 360p as a downloaded video file (to exclude javascript and browser sandboxing).

CPU performance is not a bottleneck, but architecture and implementation of Xen/Xorg itself, probably.

2 Likes

Can you elaborate, what is the so called “fact”?

I may have misunderstood but the sentence I quoted implies that it is generally impossible to play 1080p video smoothly on any user PC running Qubes OS. What I linked to shows it is not so.

Now I am updating what I said: it was so but it seems it is not so any more. In 4.1.2 I was able to play 1080p at 4x speed in full screen without any lag whatsoever. In 4.2 I can’t play anything, just like you. It is not jumpy. It just does not play (neither in browser, nor in mpv).

So - sorry. I just haven’t played anything after upgrading and facts have obviously been “upgraded” too.

That youtube 1080p (even 360p) is jumpy even on modern Intel CPUs?

I don’t use YouTube and I believe everyone should avoid its anti-privacy nightmare too. To play YT videos I normally use public Invidious instances - no JS required, onion domains, wonderful. Sadly, the issue from above remains. Has anyone reported it on GitHub?

Update:

I don’t know why but today everything seems to work for me. Example:

  1. Open in Tor Browser (DASH for hires requires JavaScript):
  1. Play and choose 1080p resolution from bottom right menu

  2. Make it full screen.

It plays fine.

What about city panning video video above?

Answered in the other tread.

How important is it that Ytfzf has released its final version and won’t be updated or patched any longer?

Thanks for pointing it out! That version fixes the two issues that my patch in this post addressed, so that patch and the changes therein are not necessary any more (though you may still want to apply the preview side config change).

As to the announcement about no more patches: it means that ytfzf will likely start accumulating bugs over time that won’t be fixed, so at some point it may become unusable. It also means that any security-related vulnerabilities likely won’t be addressed with a patch. However, it is highly recommended not to run programs like ytfzf (i.e. hobby projects posted on GitHub that you don’t audit fully) in a trusted VM anyway, especially since it accesses the internet and processes lots of arbitrary data. So this is where QubesOS really shines: you can run this program in a qube separate from your qubes with important data, such as in a properly configured DVM (recommended).

In the future various VM hardening measures will hopefully also become easier to implement, which will further increase security. Should someone have installed ytfzf in a (base) template for some reason, then this might be the time to revise that decision.