You are not logged in.

#1 2021-07-13 20:45:33

archqt
Member
Registered: 2015-04-29
Posts: 203

video in browser and in vlc [SOLVED]

Hi,
when i watch some video on youtube, firefox or brave can take more than 50% of CPU. vlc for the same video is less than 6%. So my laptop do more sound when i read on the browser
I think that the browser don't use hardware decoder, but i tried to change that in firefox config or brave but it did not work.

Is there a way to change that or to force the browser to use vlc to read the video. Or better to embed vlc inside the browser to read video.

Thanks

Last edited by archqt (2021-07-15 19:16:30)

Offline

#2 2021-07-13 21:08:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

We'll need more information about your system first:

Check about:gpu and  glxinfo -B and "loginctl session-status"
And see https://bbs.archlinux.org/viewtopic.php?id=244031

----

when i read some video on youtube

"watch" , tiktok ain't literature tongue

Offline

#3 2021-07-13 22:04:20

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

glxinfo -B gives


name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) Xe Graphics (TGL GT2) (0x9a49)
    Version: 21.1.4
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.1.4
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.1.4
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.1.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

loginctl session-status gives

1 - archqt (1002)
           Since: Tue 2021-07-13 22:09:04 CEST; 1h 52min ago
          Leader: 597 (sddm-helper)
            Seat: seat0; vc1
         Display: :0
         Service: sddm-autologin; type x11; class user
         Desktop: KDE
           State: active
            Unit: session-1.scope
                  ├─  597 /usr/lib/sddm/sddm-helper --socket /tmp/sddm-auth7f78f4a4-5831-459d-b52b-9ec02a739681 --id 1 --start /usr/bin/startplasma-x11 --user archqt --autologin
                  ├─  615 /usr/bin/kwalletd5 --pam-login 7 8
                  ├─  616 /usr/bin/startplasma-x11
                  ├─  645 /usr/lib/kf5/start_kdeinit
                  ├─  646 "kdeinit5: Running..." "" "" "" "" "" "" "" "" "" ""
                  ├─  651 /usr/lib/kf5/klauncher --fd=9
                  ├─  667 /usr/bin/kded5
                  ├─  671 /usr/bin/kwin_x11
                  ├─  709 /usr/bin/ksmserver
                  ├─  721 /usr/bin/plasmashell
                  ├─  723 /usr/lib/baloo_file
                  ├─  725 /usr/bin/xembedsniproxy
                  ├─  727 /usr/bin/kaccess
                  ├─  731 /usr/lib/polkit-kde-authentication-agent-1
                  ├─  736 /usr/lib/org_kde_powerdevil
                  ├─  755 /usr/lib/DiscoverNotifier
                  ├─  759 /usr/bin/gmenudbusmenuproxy
                  ├─  780 /usr/lib/kdeconnectd
                  ├─ 1007 /usr/bin/flameshot
                  ├─ 1878 "file.so [kdeinit5] file local:/run/user/1002/klauncheryesnci.1.slave-socket local:/run/user/1002/kded5DCcPHq.2.slave-socket"
                  ├─ 1879 "file.so [kdeinit5] file local:/run/user/1002/klauncheryesnci.1.slave-socket local:/run/user/1002/kded5ebDCiB.3.slave-socket"
                  ├─ 1944 /usr/lib/kf5/kio_http_cache_cleaner
                  └─37448 "file.so [kdeinit5] file local:/run/user/1002/klauncheryesnci.1.slave-socket local:/run/user/1002/dolphinPcPUvf.13.slave-socket"

juil. 13 23:59:05 computer kwrite[39952]: kf.sonnet.core: Sonnet: Unable to load plugin "/usr/lib/qt/plugins/kf5/sonnet/sonnet_hspell.so" Error: "Cannot load library /usr/lib/qt/plugins/kf5/sonnet/sonnet_hspell.so: (libhspell.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)"
juil. 13 23:59:05 computer kwrite[39952]: kf.sonnet.core: Sonnet: Unable to load plugin "/usr/lib/qt/plugins/kf5/sonnet/sonnet_voikko.so" Error: "Cannot load library /usr/lib/qt/plugins/kf5/sonnet/sonnet_voikko.so: (libvoikko.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)"
juil. 13 23:59:36 computer kwin_x11[671]: kwin_core: XCB error: 152 (BadDamage), sequence: 52023, resource id: 15083557, major code: 143 (DAMAGE), minor code: 2 (Destroy)
juil. 13 23:59:38 computer kwin_x11[671]: kwin_core: XCB error: 152 (BadDamage), sequence: 53271, resource id: 15083757, major code: 143 (DAMAGE), minor code: 2 (Destroy)
juil. 13 23:59:39 computer kwin_x11[671]: kwin_core: XCB error: 152 (BadDamage), sequence: 54747, resource id: 15083948, major code: 143 (DAMAGE), minor code: 2 (Destroy)
juil. 13 23:59:57 computer kwin_x11[671]: kwin_core: XCB error: 152 (BadDamage), sequence: 60465, resource id: 15084606, major code: 143 (DAMAGE), minor code: 2 (Destroy)
juil. 14 00:01:03 computer kwin_x11[671]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 24318, resource id: 96468998, major code: 18 (ChangeProperty), minor code: 0
juil. 14 00:01:03 computer kwin_x11[671]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 24346, resource id: 96468998, major code: 15 (QueryTree), minor code: 0
juil. 14 00:01:03 computer kwin_x11[671]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 24421, resource id: 96469068, major code: 18 (ChangeProperty), minor code: 0
juil. 14 00:01:03 computer kwrite[39952]: kf.notifications: Playing audio notification failed: Destroyed

Last edited by archqt (2021-07-14 08:41:04)

Offline

#4 2021-07-14 07:29:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

Please use "code" tags, not "quote" tags.

Did you see https://wiki.archlinux.org/title/Firefo … celeration (this is for firefox)
Esp. check the used video codec as well ("same video" doesn't necessarily mean the same file/codec when youtube is involved, but you could also open the local file in your browser for comparism)

Offline

#5 2021-07-14 09:53:45

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

When i do

sudo intel_gpu_top

The Video part is at 0% so it means that no GPU is used to decode the video. Even with vlc playing the video, or brave or firefox. In all the case Video is at 0%.
But vlc use less than 9% of CPU and browser use more than 40%

Offline

#6 2021-07-14 10:06:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,337

Re: video in browser and in vlc [SOLVED]

Did you read the link seth posted? HW acceleration needs to explicitly be enabled in many scenarios in browsers currently

Offline

#7 2021-07-14 10:22:46

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

V1del wrote:

Did you read the link seth posted? HW acceleration needs to explicitly be enabled in many scenarios in browsers currently

Yes but it doesn't work if i do

sudo vainfo

then i have this error

error: XDG_RUNTIME_DIR not set in the environment.
vaInitialize failed with error code -1 (unknown libva error),exit

I also change config on firefox but still the same

Last edited by archqt (2021-07-14 10:31:48)

Offline

#8 2021-07-14 10:46:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,337

Re: video in browser and in vlc [SOLVED]

why do you think you need to run that as root?

Offline

#9 2021-07-14 11:29:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

Even with vlc playing the video, or brave or firefox. In all the case Video is at 0%.
But vlc use less than 9% of CPU and browser use more than 40%

On this matter you're comparing apples and oranges.

1. The youtube video might use a different codec than your local file and eg. HEVC is far more expensive to decode than h264
2. There's more to a "youtube video" than just the video: javascript, the video overlays, live chats, google tracking you…

Offline

#10 2021-07-14 12:52:16

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

V1del wrote:

why do you think you need to run that as root?

Else i only have this error

vaInitialize failed with error code -1 (unknown libva error),exit

Offline

#11 2021-07-14 13:08:13

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

1. The youtube video might use a different codec than your local file and eg. HEVC is far more expensive to decode than h264

There is no local file. I'm watching a streaming file from youtube with vlc, or brave or firebox

2. There's more to a "youtube video" than just the video: javascript, the video overlays, live chats, google tracking you…

Sure but i made a pause of the video, and the browser was at less than 1% CPU, so the overuse of the CPU is not done but that. I have 2 process on brave 59% and 30%  and only 6% on vlc.

Offline

#12 2021-07-14 13:10:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

Else i only have this error

Bottom of https://wiki.archlinux.org/title/Hardwa … ing_VA-API

I'm watching a streaming file from youtube with vlc, or brave or firebox

What no way means that the same video codec is selected.
YT has "stats for nerd" and vlc a debug/video info window.

Offline

#13 2021-07-14 14:27:13

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

seth wrote:

Else i only have this error

Bottom of https://wiki.archlinux.org/title/Hardwa … ing_VA-API

I'm watching a streaming file from youtube with vlc, or brave or firebox

What no way means that the same video codec is selected.
YT has "stats for nerd" and vlc a debug/video info window.

Same codec is used, H264-MPEG-4 AVC1 in both case. For the CPU usage In firefox 80% and 47%, (2 threads) and vlc 5%

I even try a local file, Firefox 33% and VLC 6%

Offline

#14 2021-07-14 14:29:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

Depending on the resolution, vlc is probably *not* decoding that in SW at that CPU load.
Did you check the used decoder? (I don't care what intel_gpu_top says)

Offline

#15 2021-07-14 14:41:04

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

seth wrote:

Depending on the resolution, vlc is probably *not* decoding that in SW at that CPU load.
Did you check the used decoder? (I don't care what intel_gpu_top says)

What SW means ? Software i guess. But as intel_gup_top says 0% on video it means GPU is not used to decode the stream.

How can we know which decoder is used ?

Visually image on vlc has a better quality (a few)

Last edited by archqt (2021-07-14 14:53:22)

Offline

#16 2021-07-14 14:48:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

What SW means ?

"Software"

How can we know which decoder is used ?

"vlc -v someporn.mp4"

Offline

#17 2021-07-14 14:54:35

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

seth wrote:

What SW means ?

"Software"

How can we know which decoder is used ?

"vlc -v someporn.mp4"

lol Ok i try that but on C++ video not on porn guy ?

Offline

#18 2021-07-14 15:00:47

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

vlc -v "CppCon 2018 Jason Turner “Applied Best Practices”.mp4"

VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/demux/libgme_plugin.so' (libgme.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                                  
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/demux/libts_plugin.so' (libaribb24.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                               
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libkate_plugin.so' (libtiger.so.5: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                               
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libaribsub_plugin.so' (libaribb24.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                          
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libmpg123_plugin.so' (libmpg123.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                            
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libzvbi_plugin.so' (libzvbi.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                                
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/services_discovery/libmicrodns_plugin.so' (libmicrodns.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                           
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/control/liblirc_plugin.so' (liblirc_client.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                       
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libprojectm_plugin.so' (libprojectM.so.3: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libgoom_plugin.so' (libgoom2.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                       
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/video_output/libaa_plugin.so' (libaa.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                                             
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access_output/libaccess_output_shout_plugin.so' (libshout.so.3: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)                                                                                        
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/liblinsys_sdi_plugin.so' (libzvbi.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libnfs_plugin.so' (libnfs.so.13: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libdc1394_plugin.so' (libdc1394.so.25: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libv4l2_plugin.so' (libzvbi.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/stream_filter/libaribcam_plugin.so' (libaribb25.so.0: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/stream_out/libstream_out_chromaprint_plugin.so' (libchromaprint.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
[00005573171e5690] main libvlc: Lancement de vlc avec l'interface par défaut. Utiliser « cvlc » pour démarrer VLC sans interface.
[00007fedb8001180] mp4 demux warning: elst box found
[00007fedb8001180] mp4 demux warning: STTS table of 1 entries
[00007fedb8001180] mp4 demux warning: CTTS table of 79921 entries
[00007fedb8001180] mp4 demux warning: STTS table of 1 entries
[00007fedb933feb0] faad decoder warning: decoded zero sample
[00007fed98006360] gl gl: Initialized libplacebo v3.120.3 (API v120)
[00007fed98006360] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
[00007fed98006360] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fed98006360] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fed987ffb50] vaapi_filters filter warning: Using SW chroma filter for 1280x720 VAOP -> I420
[00007fed987e5c70] gl gl: Initialized libplacebo v3.120.3 (API v120)
[00007fedb9244d60] avcodec decoder: Using OpenGL/VAAPI backend for VDPAU for hardware decoding
[h264 @ 0x7fedb9266a80] Failed setup for format vdpau: hwaccel initialisation returned error.
[00007fedb9244d60] avcodec decoder error: existing hardware acceleration cannot be reused
[00007fed98799560] gl gl: Initialized libplacebo v3.120.3 (API v120)
[00007fed98799560] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
[00007fed98799560] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fed98799560] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fed987faf30] vaapi_filters filter warning: Using SW chroma filter for 1280x720 VAOP -> I420
[00007fed98889630] gl gl: Initialized libplacebo v3.120.3 (API v120)
[00005573172eebd0] pulse audio output warning: starting late (-13505 us)

It seems to try to use existing Hardware acceleration but it failed

Thanks

Last edited by archqt (2021-07-14 15:01:07)

Offline

#19 2021-07-14 15:10:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: video in browser and in vlc [SOLVED]

It seems to try to use existing Hardware acceleration but it failed

Yup.
I suggest to get your HW decoding config fixed (see link in #12) and live w/ the browser overhead (at a lower level)

Offline

#20 2021-07-14 15:43:49

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: video in browser and in vlc [SOLVED]

If the browser overhead is still too much with hardware decoding, you can try one of the "Send to media player" addons to make calling vlc easier.
https://add0n.com/send-to.html
https://addons.mozilla.org/de/firefox/search/?q=vlc

Last edited by progandy (2021-07-14 15:44:43)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#21 2021-07-14 17:53:23

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

progandy wrote:

If the browser overhead is still too much with hardware decoding, you can try one of the "Send to media player" addons to make calling vlc easier.
https://add0n.com/send-to.html
https://addons.mozilla.org/de/firefox/search/?q=vlc

It needs to have nodeJS installed on my computer. And i think it is too heavy for this simple thing.

Thanks for the suggestion

Offline

#22 2021-07-14 18:56:44

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

I installed intel-media-driver and now on VLC hardware decoding works

gl gl: Initialized libplacebo v3.120.3 (API v120)
[00007f0c212450c0] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 21.2.1 () for hardware decoding

I try to see if it can work now on firefox or brave

Offline

#23 2021-07-15 19:17:30

archqt
Member
Registered: 2015-04-29
Posts: 203

Re: video in browser and in vlc [SOLVED]

As it seems that there is a little of decoding with hardware on firefox (intel_gpu_top) i put this topic oon solved. But firefox still use far more CPU than vlc

Offline

Board footer

Powered by FluxBB