View previous topic :: View next topic |
Author |
Message |
saturnalia0 Tux's lil' helper
Joined: 13 Oct 2016 Posts: 136
|
Posted: Fri Dec 09, 2016 10:55 pm Post subject: How to have H264 hardware decoding on Firefox? |
|
|
I need HW H264 decoding for YouTube HD videos. `about:support` used to say it was unavailable because Firefox was compiled without ffmpeg support, so I recompiled it with the ffmpeg useflag, and now `about:support` only says "Supports Hardware H264 Decoding No;". Perhaps my ffmpeg build is missing some use flags? I'm not sure how to proceed.
`equery u firefox`: http://pastebin.com/fsvHCsF5
`equery u ffmpeg`: http://pastebin.com/iXcdgedz
I tried using a clean Firefox profile also. I'm using the latest version of ffmpeg and firefox from Gentoo's repos. |
|
Back to top |
|
|
saboya Guru
Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Fri Dec 09, 2016 11:55 pm Post subject: |
|
|
You forgot to metion you GPU. If it's Nvidia, you have +vdpau, so it's correct. But if it's Intel, you need +vaapi |
|
Back to top |
|
|
cboldt Veteran
Joined: 24 Aug 2005 Posts: 1046
|
Posted: Sat Dec 10, 2016 10:32 am Post subject: |
|
|
Your ffmpeg "x264" useflag is unset. |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sat Dec 10, 2016 11:43 am Post subject: |
|
|
There is no hardware decoding in Firefox on Linux. The Mozilla devs know what to do to implement it, but it's quite low priority for them, so who knows when it'll happen.
freshplayerplugin supports hardware decoding, you can use that together with pepperflash, but that only covers flash, not html5 video.
@cboldt: x264 is an encoder only, it's used to create videos, not play them. |
|
Back to top |
|
|
saturnalia0 Tux's lil' helper
Joined: 13 Oct 2016 Posts: 136
|
Posted: Sat Dec 10, 2016 11:55 am Post subject: |
|
|
Gusar wrote: | There is no hardware decoding in Firefox on Linux. The Mozilla devs know what to do to implement it, but it's quite low priority for them, so who knows when it'll happen.
freshplayerplugin supports hardware decoding, you can use that together with pepperflash, but that only covers flash, not html5 video.
@cboldt: x264 is an encoder only, it's used to create videos, not play them. |
Thanks. I re-emerged ffmpeg with x264 before reading that, to no avail of course.
About Flash, I'm currently using youtube-dl and then watching the videos on mplayer, but if it's "hd720" my computer can't play it (mplayer says it's too slow, video is in slow mo).
saboya wrote: | You forgot to metion you GPU. If it's Nvidia, you have +vdpau, so it's correct. But if it's Intel, you need +vaapi |
It's AMD. From about:support: X.Org -- Gallium 0.4 on AMD CEDAR (DRM 2.43.0 / 4.4.26-gentoo, LLVM 3.7.1) |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sat Dec 10, 2016 12:25 pm Post subject: |
|
|
saturnalia0 wrote: | About Flash, I'm currently using youtube-dl and then watching the videos on mplayer, but if it's "hd720" my computer can't play it (mplayer says it's too slow, video is in slow mo). |
Use mpv instead of mplayer and configure it properly, then even 1080p video will work. I'd suggest to use VDPAU. So compile mesa, ffmpeg and mpv with the vdpau USE flag, then run mpv like soYou can also put hwdec=vdpau in ~/.config/mpv/mpv.conf (create the file if it doesn't exist yet) so it'll always use hardware decoding.
BTW, mpv has direct youtube-dl integration if you compile it with the lua or luajit flag. Then you can simply do Code: | mpv https://www.youtube.com/watch?v=VcjzHMhBtf0 | and it'll play directly.
Another BTW, use the ~testing version of mpv, the "stable" 0.9.2 release is ancient. |
|
Back to top |
|
|
cboldt Veteran
Joined: 24 Aug 2005 Posts: 1046
|
Posted: Sat Dec 10, 2016 1:12 pm Post subject: |
|
|
Thanks @gusar - appreciate your correction and additional valuable information |
|
Back to top |
|
|
saturnalia0 Tux's lil' helper
Joined: 13 Oct 2016 Posts: 136
|
Posted: Sat Dec 10, 2016 2:00 pm Post subject: |
|
|
Gusar wrote: | Use mpv instead |
Thanks, that worked. Though using --hwdec=vdpau did not, it gives out [a bunch of OpenGL errors](http://pastebin.com/8TeRV1V9) and the video is just a blue screen.
WIhtout vdpau it uses "VO: [opengl] 1920x1080 yuv420p".
Probably has soemthing to do with this (from vdpauinfo):
H264_CONSTRAINED_BASELINE --- not supported ---
H264_EXTENDED --- not supported ---
H264_PROGRESSIVE_HIGH --- not supported ---
H264_CONSTRAINED_HIGH --- not supported ---
H264_HIGH_444_PREDICTIVE --- not supported ---
HEVC_MAIN --- not supported ---
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported --- |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sat Dec 10, 2016 3:12 pm Post subject: |
|
|
saturnalia0 wrote: | Though using --hwdec=vdpau did not, it gives out [a bunch of OpenGL errors](http://pastebin.com/8TeRV1V9) and the video is just a blue screen. |
Hmm, there was a bug recently in mpv, but I though it's fixed now, are you using version 0.22?. It could also have something to do with the mesa version - are you using 12 or 13? Well, there's also the vdpau output in addition to the opengl one, you could try that: Code: | mpv --hwdec=vdpau --vo=vdpau |
saturnalia0 wrote: | Probably has soemthing to do with this (from vdpauinfo): |
It's unlikely your videos are any of those profiles, pretty much everything out there is H264_HIGH. The problem is either mpv or mesa (or both ). The vdpau output should work either way. |
|
Back to top |
|
|
saturnalia0 Tux's lil' helper
Joined: 13 Oct 2016 Posts: 136
|
Posted: Sat Dec 10, 2016 9:35 pm Post subject: |
|
|
Specifying the vo fixed it, thanks! |
|
Back to top |
|
|
|