Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VP9 videos do not play in Chromium 87 or newer #13

Open
TheWeirdDev opened this issue Nov 25, 2020 · 36 comments · May be fixed by #15
Open

VP9 videos do not play in Chromium 87 or newer #13

TheWeirdDev opened this issue Nov 25, 2020 · 36 comments · May be fixed by #15

Comments

@TheWeirdDev
Copy link

TheWeirdDev commented Nov 25, 2020

I have upgraded my chromium to the latest version (currently 87) and VP9 decoding has stopped working. I get this error whenever I try to play a VP9 video on YouTube:

image

Chromium GPU page shows me this error:

[980967:1053074:1125/212921.939923:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID
[980967:1053074:1125/212921.940044:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream
[980967:1053155:1125/212926.108133:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID
[980967:1053155:1125/212926.108211:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream

And media page shows this error:
image

I tried using h264ify extension and h264 videos work just fine with hardware acceleration (MojoVideoDecoder). So only VP9 videos are not playing.

Seems like other people have the same problem too: saiarcot895/chromium-ubuntu-build#102

I'm not entirely sure if this bug is related to this project or not. Feel free to close it if it's not.

Thanks for your help.

@TheWeirdDev TheWeirdDev changed the title Does not work in Chromium 87 VP9 videos do not play in Chromium 87 Nov 25, 2020
@limon
Copy link

limon commented Nov 26, 2020

same problem, vp9 decoding not works

@asemarafa
Copy link

@Justkant
Copy link

Does libva-vdpau-driver-chromium have vp9 support ?

libva-vdpau-driver-chromium doesn't seem to have vp9 support, I'll try to find more infos later when I have some time.

@gardotd426
Copy link

libva-vdpau-driver-chromium does not have vp9 support, it will use software decoding for videos using vp9, though h264ify can usually force H264.

Right now I'm using libva-vdpau-driver-chromium w/ h264ify, and it does work w/ hw acceleration on most videos, but they're limited to 1080p even when 1440 and 4K should be available. Without h264ify, hw acceleration almost never gets used, and with libva-vdpau-driver-vp9-git, obviously I'm experiencing the same stuff as the rest of you.

@Justkant
Copy link

Justkant commented Dec 18, 2020

My bad btw, I misinterpreted the changes in [email protected]~ppa2~20.04.1 and libva-vdpau-driver-chromium

@gardotd426
Copy link

So I guess the dev has no interest in this...?

@krakow10
Copy link

they're limited to 1080p even when 1440 and 4K should be available.

YouTube only delivers above 1080p in VP9 or sometimes AV1. You can confirm this by listing the available stream formats with youtube-dl -F URL

@gardotd426
Copy link

YouTube only delivers above 1080p in VP9 or sometimes AV1. You can confirm this by listing the available stream formats with youtube-dl -F URL

Yeah that was my point. Without h264ify to force h264, above 1080p videos will play, but they won't use hw decoding. If I want hw decoding, I have to use h264ify which means I'm limited to 1080p which sucks because my main monitors are 2K and I also have a 4K one.

Again, this is only with libva-vdpau-driver-chromium, because with libva-vdpau-driver-vp9-git, the videos just won't play as everyone else has demonstrated (starting with v87).

@xuanruiqi
Copy link

Is anyone working on this? I would love to help but I'm currently completely lost...

@nE0sIghT
Copy link

nE0sIghT commented Feb 1, 2021

Here is logs with VDPAU_VIDEO_DEBUG=1

vdpau_video: NVIDIA VDPAU Driver Shared Library  450.80.02  Wed Sep 23 00:46:46 UTC 2020
vdpau_video: Failed to create dedicated X11 display! Using fallback.
vdpau_video: NVIDIA VDPAU Driver Shared Library  450.80.02  Wed Sep 23 00:46:46 UTC 2020
vdpau_video: vdpau_BeginPicture [ctx: 0x5577266d0700, context: 33554432, render_target: 50331648]
vdpau_video: vdpau_RenderPicture [ctx: 0x5577266d0700, context: 33554432, buffers: 0x5577265d4db0, num_buffers: 3]
vdpau_video: ... buffers[0]->type: VAPictureParameterBufferType (0)
vdpau_video: ... buffers[1]->type: VASliceParameterBufferType (4)
vdpau_video: ... buffers[2]->type: VASliceDataBufferType (5)
vdpau_video: translate_VAPictureParameterBufferVP9 [driver_data: 0x55772a88dea0, obj_context: 0x7fa674ed3698, obj_buffer: 0x7fa674ed3690]
vdpau_video: translate_VASliceParameterBufferVP9 [driver_data: 0x55772a88dea0, obj_context: 0x7fa674ed3698, obj_buffer: 0x7fa674ed3690, obj_buffer->num_elements: 1]
vdpau_video: vdpau_EndPicture [ctx: 0x5577266d0700, context: 33554432]
vdpau_video: rendering to surface 3000000
vdpau_video: vdp_status after ensure = 0
vdpau_video: vdp_status after render = 0
[18591:18876:0201/175854.141155:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID
[18591:18876:0201/175854.141306:ERROR:vaapi_video_decode_accelerator.cc(527)] Error decoding stream

@TheWeirdDev TheWeirdDev changed the title VP9 videos do not play in Chromium 87 VP9 videos do not play in Chromium 87 or newer Feb 1, 2021
@xuanruiqi
Copy link

Still no progress? I would love to help but I know nothing about video decoding or VDPAU, so...

@Leseratte10
Copy link

I have this issue as well, here's a full VDPAU_VIDEO_TRACE=1 log if that's helpful. It'd be cool if that could be fixed:

Failed to create dedicated X11 display!
vdpau_video: NVIDIA VDPAU Driver Shared Library  450.102.04  Tue Dec 29 06:43:11 UTC 2020
vdpau_video: vdpau_BeginPicture [ctx: 0x5632586165d0, context: 33554432, render_target: 50331648]
vdpau_video: vdpau_RenderPicture [ctx: 0x5632586165d0, context: 33554432, buffers: 0x56324ddd26d0, num_buffers: 3]
vdpau_video: ... buffers[0]->type: VAPictureParameterBufferType (0)
vdpau_video: ... buffers[1]->type: VASliceParameterBufferType (4)
vdpau_video: ... buffers[2]->type: VASliceDataBufferType (5)
vdpau_video: translate_VAPictureParameterBufferVP9 [driver_data: 0x56325a92ab50, obj_context: 0x7fafb5a40588, obj_buffer: 0x7fafb5a40580]
vdpau_video: translate_VASliceParameterBufferVP9 [driver_data: 0x56325a92ab50, obj_context: 0x7fafb5a40598, obj_buffer: 0x7fafb5a40590, obj_buffer->num_elements: 1]
vdpau_video: luma_ac_quant_scale=42 ==> q_index=35
vdpau_video: luma_dc_quant_scale=37 ==> delta_q_y_dc=0
vdpau_video: chroma_dc_quant_scale=37 ==> delta_q_uv_dc=0
vdpau_video: chroma_ac_quant_scale=42 ==> delta_q_uv_ac=0
vdpau_video: translate_VASliceDataBuffer: VP9: process slice param #0
vdpau_video: vdpau_EndPicture [ctx: 0x5632586165d0, context: 33554432]
vdpau_video:     VdpPictureInfoVP9 = {
vdpau_video:         .width = 640,
vdpau_video:         .height = 360,
vdpau_video:         .lastReference = 0xffffffff,
vdpau_video:         .goldenReference = 0xffffffff,
vdpau_video:         .altReference = 0xffffffff,
vdpau_video:         .colorSpace = 2,
vdpau_video:         .profile = 0,
vdpau_video:         .frameContextIdx = 0,
vdpau_video:         .keyFrame = 1,
vdpau_video:         .showFrame = 1,
vdpau_video:         .errorResilient = 0,
vdpau_video:         .frameParallelDecoding = 0,
vdpau_video:         .subSamplingX = 1,
vdpau_video:         .subSamplingY = 1,
vdpau_video:         .intraOnly = 0,
vdpau_video:         .allowHighPrecisionMv = 0,
vdpau_video:         .refreshEntropyProbs = 1,
vdpau_video:         .refFrameSignBias = {
vdpau_video:             0x00, 0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .bitDepthMinus8Luma = 0,
vdpau_video:         .bitDepthMinus8Chroma = 0,
vdpau_video:         .loopFilterLevel = 4,
vdpau_video:         .loopFilterSharpness = 0,
vdpau_video:         .modeRefLfEnabled = 0,
vdpau_video:         .log2TileColumns = 1,
vdpau_video:         .log2TileRows = 0,
vdpau_video:         .segmentEnabled = 0,
vdpau_video:         .segmentMapUpdate = 0,
vdpau_video:         .segmentMapTemporalUpdate = 0,
vdpau_video:         .segmentFeatureMode = 1,
vdpau_video:         .segmentFeatureEnable = {
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .segmentFeatureData = {
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00,
vdpau_video:             0x00, 0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .mbSegmentTreeProbs = {
vdpau_video:             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .segmentPredProbs = {
vdpau_video:             0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .reservedSegment16Bits = {
vdpau_video:             0x00, 0x00
vdpau_video:         }
vdpau_video:         .qpYAc = 35,
vdpau_video:         .qpYDc = 0,
vdpau_video:         .qpChDc = 0,
vdpau_video:         .qpChAc = 0,
vdpau_video:         .activeRefIdx = {
vdpau_video:             0x00, 0x00, 0x00
vdpau_video:         }
vdpau_video:         .resetFrameContext = 0,
vdpau_video:         .mcompFilterType = 0,
vdpau_video:         .mbRefLfDelta = {
vdpau_video:             0x01, 0x00, 0xffffffff, 0xffffffff
vdpau_video:         }
vdpau_video:         .mbModeLfDelta = {
vdpau_video:             0x00, 0x00
vdpau_video:         }
vdpau_video:         .uncompressedHeaderSize = 18,
vdpau_video:         .compressedHeaderSize = 143,
vdpau_video:     };
vdpau_video:     VdpBitstreamBuffer (3 bytes) = {
vdpau_video:         .buffer = {
vdpau_video:             0x00, 0x00, 0x01,
vdpau_video:         }
vdpau_video:     };
vdpau_video:     VdpBitstreamBuffer (20255 bytes) = {
vdpau_video:         .buffer = {
vdpau_video:             0x82, 0x49, 0x83, 0x42, 0x40, 0x27, 0xf0, 0x16, 0x74, 0x08, 0x38, 0x24, 0x1c, 0x18, 0x46,
vdpau_video:             0x10, 0x04, 0x78, 0x7f, 0xd5, 0xf9, 0xbe, 0x6f, 0xc8, 0xe6, 0x3f, 0x99, 0xf9, 0x7f, 0xde,
vdpau_video:             0xff, 0xa1, 0xff, 0x6f, 0xfc, 0xef, 0x87, 0xe9, 0xff, 0x27, 0xc2, 0xfc, 0x9e, 0x93, 0xf2,
vdpau_video:             0x7c, 0x2f, 0xf7, 0x7c, 0x1f, 0xa1, 0xff, 0x77, 0xd1, 0x7a, 0x4f, 0xf7, 0x7e, 0x27, 0xfb,
vdpau_video:             0xde, 0x17, 0xc1, 0x7f, 0x9d, 0xf0, 0xbd, 0x17, 0x96, 0x7a, 0x5f, 0xcf, 0xe9, 0x7f, 0xde,
vdpau_video:             0xfc, 0x9f, 0xec, 0xfc, 0x8f, 0x4b, 0xca, 0x3d, 0x6f, 0xc4, 0xfd, 0x5f, 0x30, 0x85, 0x76,
vdpau_video:             0xee, 0xea, 0x9e, 0xbb, 0xb4, 0xfb, 0x1e, 0xc7, 0xbc, 0x5c, 0xbe, 0xfd, 0x2b, 0xc5, 0x9c,
vdpau_video:             0xb7, 0x8f, 0xad, 0x7b, 0x1d, 0xd1, 0xb9, 0x73, 0x5a, 0xf6, 0xfb, 0xba, 0x19, 0x9e, 0x91,
vdpau_video:             0xfc, 0xe7, 0xb4, 0x7f, 0x5b, 0xbb, 0x48, 0xd0, 0xbd, 0xdd, 0xd2, 0x36, 0x1b, 0xa4, 0xa8,
vdpau_video:             0xf9, 0x9b, 0xcb, 0x99, 0xf9, 0x22, 0x7b, 0xfa, 0x27, 0x1c, 0x22, 0xf7, 0x43, 0xe8, 0xb9
vdpau_video:         }
vdpau_video:     };
vdpau_video: rendering to surface 3000000
vdpau_video: vdp_status after ensure = 0
vdpau_video: vdp_status after render = 0
[1401750:1402185:0221/150525.055664:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID
[1401750:1402185:0221/150525.055746:ERROR:vaapi_video_decode_accelerator.cc(528)] Error decoding stream

@mohad12211
Copy link

having the same issue with brave browser (chromium based), I don't know what information to post to help so please inform us.

@TheWeirdDev
Copy link
Author

I emailed the author of this project a few weeks ago and still haven't received a response. I don't think this bug will ever be fixed unless someone else takes over.

@xuanruiqi
Copy link

That's sad. Seems that no one knows how to work it out...

@xtknight
Copy link
Owner

xtknight commented Jun 9, 2021

Apologize for the silence; I haven't had time to maintain this as I had wanted. If anyone is willing to takeover, that's fine with me and I can give them the proper permissions to do so, or approve pull requests, etc.

As for this issue, I don't believe the VP9 codec decoding part is returning an error code and suspect it's a problem with the VDPAU/VA-API bridge part. Unfortunately, I know as much about this part as you guys do, so I don't think I would be much help. I would start by seeing if other codecs from the original code upon which this code is based are working properly (e.g., MPEG1, MPEG2, MPEG4, VC1, H264), whether through Chromium or otherwise. Failing that, it would probably require re-compiling Chromium and/or the VA-API library and adding debug lines around the VA-API calls to figure out what's going on exactly.

I can't guarantee I'll have any time to look into this, but just wanted to break the silence at least.

Andrew

@xtknight
Copy link
Owner

xtknight commented Jun 9, 2021

I have posted a diff between my codebase and Arch. I guess this may be a start point to figure out what's going on.

diffs_arch0.74_vp9_src.patch.tar.gz

Testing will take me awhile but it's worth looking into vdpau_CreateSurfaceFromV4L2Buf and vdpau_common_Initialize

Also worth looking into issues with Chromium 87 itself...
saiarcot895/chromium-ubuntu-build#98

@gardotd426
Copy link

I don't know how much this helps, but if I downgrade Chromium to 86.0.4240.75, vp9 does still work. I mean I guess that's to be expected but I figured it would potentially be some useful information.

@coolbooks2
Copy link

I don't know if this helps either but in the latest Chromium it now fails silently and just plays the h.264 1080p video. The following errors print in console.

[2756:2790:0615/114348.742615:ERROR:token_service_table.cc(140)] Failed to decrypt token for service AccountId-101375343074270199767
[2786:2786:0615/114348.857787:ERROR:gpu_init.cc(440)] Passthrough is not supported, GL is desktop
[2786:3029:0615/114402.940908:ERROR:vaapi_utils.cc(49)] vaMapBuffer failed: invalid VABufferID
[2786:3029:0615/114402.940996:ERROR:vaapi_video_decode_accelerator.cc(534)] Error decoding stream
[2786:3031:0615/114403.261004:ERROR:vaapi_utils.cc(49)] vaMapBuffer failed: invalid VABufferID
[2786:3031:0615/114403.261096:ERROR:vaapi_video_decode_accelerator.cc(534)] Error decoding stream
[2786:3145:0615/114455.563439:ERROR:vaapi_utils.cc(49)] vaMapBuffer failed: invalid VABufferID
[2786:3145:0615/114455.563537:ERROR:vaapi_video_decode_accelerator.cc(534)] Error decoding stream
[2786:3147:0615/114455.826419:ERROR:vaapi_utils.cc(49)] vaMapBuffer failed: invalid VABufferID
[2786:3147:0615/114455.826511:ERROR:vaapi_video_decode_accelerator.cc(534)] Error decoding stream
[3118:4:0615/114456.411417:ERROR:mojo_audio_output_ipc.cc(187)] MojoAudioOutputIPC failed to acquire factory

@beew
Copy link

beew commented Jul 9, 2021

Yes, I can confirm that the vp9 format doesn't exist for Chromium anymore. But this only happens in conjunction with using vdpau-va-driver-vp9 in a Nvidia environment, In another intel box with same version of Chromium installed from same source the vp9 options are available (vaapi also activated though vp9 hardware acceleration is not supported by graphic card there)

Chromium 91.0.4472.27 installed from the Chromium-beta ppa for Ubuntu https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-beta

Go to https://base-n.de/webm/VP9%20Sample.html the vp9 sample shows a blackbox

Go to https://www.youtube.com/watch?v=h3fUgOKFMNU and check the settings the highest resolution shown in Chromium is 1080p60fps but in Firefox additional options up to 4320p60 are availiable.

h264ify is not installed.

As far as the h264 streams go vaapi works perfectly.

@xuanruiqi
Copy link

xuanruiqi commented Jul 9, 2021

I have some time to tinker things recently, and I volunteer to help fix this.
I'm totally lost, though, and I know nothing about multimedia on Linux. Could anyone possibly provide any guidance?

(BTW, Chrome still has VP9)

@xuanruiqi
Copy link

xuanruiqi commented Jul 26, 2021

Bad news: seems that YouTube, at least, has killed 1080p for h264... Only option for 1080p+ is VP9. Nevermind, fake news. h264 still works.

nE0sIghT added a commit to nE0sIghT/vdpau-va-driver-vp9 that referenced this issue Sep 25, 2021
Client must use vaDestroyBuffer to destroy buffers.

Fixes: xtknight#13
Signed-off-by: Yuri Konotopov <[email protected]>
@nE0sIghT nE0sIghT linked a pull request Sep 25, 2021 that will close this issue
nE0sIghT added a commit to nE0sIghT/vdpau-va-driver-vp9 that referenced this issue Sep 26, 2021
Client must use vaDestroyBuffer to destroy buffers.

Fixes: xtknight#13
Signed-off-by: Yuri Konotopov <[email protected]>
@TheWeirdDev
Copy link
Author

#15 Fixes this issue. Give it a try (You have to build it manually)

And don't upgrade to chromium 95!

@xuanruiqi
Copy link

Thanks!!!
BTW, what's the problem with chromium 95?

@TheWeirdDev
Copy link
Author

Thanks!!! BTW, what's the problem with chromium 95?

Chromium 95 uses Ozone Platform by default which doesn't support hw accelerated video decoding and there is no option to disable it. I've read in ArchLinux forum that people are having issues with it, so it's better not to upgrade at the moment until a new workaround is found.

On Chromium 94 I had another problem that it did fall back to software decoding and I found out I had to kill the 'GPU Process' in chromium's task manager in order to make it work, I'm not sure if there was something wrong with my installation or it affects everyone but if you encounter that, now you know how to fix it.

@xuanruiqi
Copy link

I just forked this repo, and applied the patch in PR #15. I'm also planning to keep code up-to-date wrt upstream. You may switch to my fork if you'd like.

@TheWeirdDev
Copy link
Author

I just forked this repo, and applied the patch in PR #15. I'm also planning to keep code up-to-date wrt upstream. You may switch to my fork if you'd like.

That's great. Can you provide an AUR package too?

@xuanruiqi
Copy link

I can tell the current maintainer to switch to my branch. If it doesn't happen soon, I'll file to orphan and then adopt the package.

I just incorporated some Arch Linux fixes (used in the libva-vdpau-driver package) too. This should remove errors spitting out on chrome://gpu.

@gardotd426
Copy link

@xuarnruiqi you won't allow issues on your fork, but anyway right now Chromium for some reason is forcing H264. Hardware accelerated decoding is working (I'm looking at GWE) but it won't use VP9. Weirdly though there are no error messages when running from the terminal. A couple hours ago this wasn't an issue.

@xuanruiqi
Copy link

@gardotd426 I just enabled issues. That's very strange, I couldn't reproduce this at all. You're sure there's no h264ify running?

@gardotd426
Copy link

I couldn't reproduce this at all.

What version of chromium are you on? If you're up to date on Arch it should be 95.0.4638.54-2.

You're sure there's no h264ify running?

Yeah, I've triple checked. I could just remove the extension, I'll see what that does.

Ahhh. So I'd done some hack to try and enable Sync in Chromium (since that was removed), and it added all my old extensions, including enhancedh264ify and it was enabled. So it's working.

However, it still doesn't work in Brave, and Brave always worked with GPU acceleration before. It just stopped working like, yesterday. But yeah Chromium is back to playing VP9

@TheWeirdDev
Copy link
Author

TheWeirdDev commented Oct 22, 2021

Chromium 95 might not work with VA-API since they forced OzonePlatform for both X11 and Wayland and it has issues with video acceleration. They fixed it in v96 tho. So it's better to skip v95.

@gardotd426
Copy link

gardotd426 commented Oct 22, 2021 via email

@TheWeirdDev
Copy link
Author

@gardotd426 That's good news. Can you share an screenshot from chrome://gpu's Video Acceleration Information
section?

@xuanruiqi
Copy link

Actually I think they shipped the fix (at least a fix) with v95, so it should have no problems. It's working for me without problems; I know nothing about Brave though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

14 participants