nvidia-vaapi-driver icon indicating copy to clipboard operation
nvidia-vaapi-driver copied to clipboard

Low framerate for some YouTube videos

Open bcrescimanno opened this issue 2 years ago • 11 comments

OS: Arch Linux DE: Gnome on X11 Firefox version: 100.0-1 (Arch package) nvidia-vaapi-driver: AUR -Git package Card Model: Nvidia RTX 3080ti Nvidia driver version: 510.68.02-1 (Arch package)

With Firefox 100 hitting in Arch today, I decided to try out this driver now that the bug that was happening FF99 was fixed. On some videos, playback is working as expected. On others, the video playback framerate is very low. I don't know if this is a specific codec issue (I don't know how to check which codec is in use on a YouTube video.

Here's an example of a video with very slow framerate when this driver is enabled. Here's the log output from a quick session where i played a few seconds of the video.

The command line I used for this test:

$ LIBVA_DRIVER_NAME=nvidia MOZ_DISABLE_RDD_SANDBOX=1 NVD_LOG=vid.log firefox

bcrescimanno avatar May 03 '22 19:05 bcrescimanno

I've just tried it with FF100 downloaded from Mozilla, and that works fine with that video. I'm a little surprised that a 24fps video would cause any problems.

The log file you attached looks fine, I see about 40ms between frames, which is exactly what you'd expect from a 24fps video.

Is the video just playing back in slow motion, or is it dropping the frames (does the video seem to skip between them)?

One thing you can try, is to use a slightly older version of this driver, either commit 51aaf5e2 or tag v0.0.5. I've recently committed a large change to how frames are decoded which might be the cause of the issue.

elFarto avatar May 03 '22 19:05 elFarto

Is the video just playing back in slow motion, or is it dropping the frames (does the video seem to skip between them)?

Good question. I just looked again to be sure and it's a slow motion / jutter effect--but, from what I can tell, no frames are being dropped.

I'll check that older version and see if the results are different. I'll also try to do a full system reboot in case an older nvidia driver is loading or something like that. Any other data I can provide?

bcrescimanno avatar May 03 '22 19:05 bcrescimanno

BTW, you can right click on the Youtube video and click 'Stats for nerds' to see how it's performing/how many frames have been dropped.

elFarto avatar May 03 '22 19:05 elFarto

Thanks for that tip! I can confirm that no frames are dropped. I can also confirm that I'm seeing this effect for all videos encoded with AV1 at 24fps . Anything at 30 or 60fps appears to play normally.

Edit: nope, I misspoke. I looked at the wrong video. It only seems to affect 24fps AV1 videos (I assumed that videos by the same creator would use the same codec; I was wrong).

bcrescimanno avatar May 03 '22 20:05 bcrescimanno

OK, last update from me for a bit: I switched over to 0.5 and the issue persists so it doesn't seem to be related to the latest commit. However, I found another video by the same creator that is also 1920x1080@24fps and AV1 encoded that works fine.

Slow Motion Video Normally Playing Video

bcrescimanno avatar May 03 '22 20:05 bcrescimanno

Just to be clear, in the Stats for nerds, does it say AVC1 or AV01 in the slow motion video? The former is H.264, the latter is AV1.

elFarto avatar May 03 '22 20:05 elFarto

Codecs av01.0.08M.08 (399) / opus (251)

bcrescimanno avatar May 03 '22 20:05 bcrescimanno

Looks like it could be related to this Firefox issue.

elFarto avatar May 03 '22 20:05 elFarto

Good find; the results absolutely sound the same. I'm trying to find some AV1 encoded 30fps videos to verify that the issue applies there as well. It's super noticeable on 24fps video and I can't help but wonder why it's working for you and not me--gotta be some kind of delta there.

bcrescimanno avatar May 03 '22 22:05 bcrescimanno

Also experiencing this exact issue. Hopefully it's fixed soon.

fxzzi avatar May 30 '22 15:05 fxzzi

Looks like a fix has been committed for this issue, and is available in this nightly build. If you can test it out when you get a chance, and let me know if it's fixed.

elFarto avatar Jun 19 '22 09:06 elFarto

This issue appears to be fixed now, closing issue.

elFarto avatar Dec 07 '22 08:12 elFarto