Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653448 - www-client/vivaldi with media-video/ffmpeg[chromium] does not support H264
Summary: www-client/vivaldi with media-video/ffmpeg[chromium] does not support H264
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Jeroen Roovers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-17 23:16 UTC by crocket
Modified: 2019-05-01 17:55 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description crocket 2018-04-17 23:16:58 UTC
media-video/ffmpeg-3.3.6
www-client/vivaldi-1.14.1077.60_p1

ffmpeg's chromium USE flag makes ffmpeg install libffmpeg.so in /usr/lib64/chromium, but it is not useable or recognized by vivaldi.

https://www.youtube.com/html5 says vivaldi doesn't support H.264

I tried to install http://gpo.zugaina.org/www-plugins/vivaldi-ffmpeg-codecs, but SRC_URI was broken.

I copied vivaldi-ffmpeg-codecs ebuild to my local overlay and updated SRC_URI and installed www-plugins/vivaldi-ffmpeg-codecs-64.0.3282.119

Finally, https://www.youtube.com/html5 says vivaldi supports H264.
Comment 1 Jeroen Roovers gentoo-dev 2018-04-18 07:13:23 UTC
(In reply to crocket from comment #0)
> media-video/ffmpeg-3.3.6
> www-client/vivaldi-1.14.1077.60_p1
> 
> ffmpeg's chromium USE flag makes ffmpeg install libffmpeg.so in
> /usr/lib64/chromium, but it is not useable or recognized by vivaldi.

Not recognised how? There is a function checkffmpeg() in /usr/bin/vivaldi that checks different locations. Which libffmpeg.so did it pick? Perhaps you can add some statements ("echo $1 $2" on the line after "export VIVALDI_FFMPEG_FOUND=YES" perhaps) that show which one it loads?
Comment 2 crocket 2018-04-18 15:33:13 UTC
$ vivaldi-stable
/usr/bin/vivaldi-stable: line 35: [: -ge: unary operator expected
/usr/bin/vivaldi-stable: line 35: [: -ge: unary operator expected

No suitable library for HTML5 MP4 (H.264/AAC) video and MP3 audio was
found, therefore only open codecs will play.
------------------------------------------------------------------------
/opt/vivaldi/vivaldi:

# Chromium's FFMpeg version N-89284-gba4dfad is the oldest known working version
# chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h
------------------------------------------------------------------------
/usr/lib64/chromium/libffmpeg.so installed by ffmpeg contains a string, "FFMpeg 3.3.6". Thus, /opt/vivaldi/vivaldi's checkffmpeg can't use it. It seems I need to install http://gpo.zugaina.org/www-plugins/chromium-codecs-ffmpeg-extra or http://gpo.zugaina.org/www-plugins/vivaldi-ffmpeg-codecs
Comment 3 crocket 2018-04-18 15:34:06 UTC
"FFMpeg 3.3.6" -> "FFMpeg version 3.3.6"
Comment 4 crocket 2018-04-18 15:35:44 UTC
According to https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-snapshot-ffmpeg-codecs, libffmpeg.so for vivaldi or opera has to be built from chromium, not ffmpeg.
Comment 5 crocket 2018-04-18 15:48:48 UTC
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-ffmpeg-codecs would be more appropraite for the current version of vivaldi on gentoo overlay.
Comment 6 crocket 2018-04-18 15:55:38 UTC
https://gist.github.com/ruario/bec42d156d30affef655 says you will need to update vivaldi-ffmpeg-codecs from time to time as Vivaldi updates its Chromium version.
Comment 7 crocket 2018-04-18 21:58:27 UTC
I suggest incorporating https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-ffmpeg-codecs into vivaldi as a USE flag.
Comment 8 crocket 2018-04-20 11:49:20 UTC
opera ignores /usr/lib64/chromium/libffmpeg.so, too.
Comment 9 Jeroen Roovers gentoo-dev 2018-05-03 10:20:50 UTC
CC: media-video@gentoo.org

The startup script for vivaldi runs some checks to find a good libffmpeg:

/usr/bin/vivaldi{,-snapshot}:
checkffmpeg '/usr/lib64/chromium/libffmpeg.so'
checkffmpeg '/usr/lib/chromium-browser/libffmpeg.so' '/usr/share/doc/chromium-codecs-ffmpeg-extra'
checkffmpeg "/usr/lib/$DEBARCH/oxide-qt/libffmpeg.so" '/usr/share/doc/oxideqt-codecs-extra'
checkffmpeg '/usr/lib64/chromium-ffmpeg-extra/libffmpeg.so' '/usr/share/doc/packages/chromium-ffmpeg-extra'

The first entry I add through a patch, the rest have as second argument what Vivaldi developers apparently see as canonical locations for a document that describes the libffmpeg in the first argument. Perhaps the first checkffmpeg line should get a second argument as well, but what file should it point to?
Comment 10 Jeroen Roovers gentoo-dev 2018-05-03 10:21:35 UTC
Also note that the line I add causes bash to complain:

/usr/bin/vivaldi: line 35: [: -ge: unary operator expected
Comment 11 crocket 2018-05-03 11:18:26 UTC
Because `grep -aom1 'FFmpeg version N-[0-9]\+-' "$1" | cut -f2 -d-` is not in double quotes, when it is an empty string,

"/usr/bin/vivaldi: line 35: [: -ge: unary operator expected" is printed on stderr.

It simply means grep -aom1 'FFmpeg version N-[0-9]\+-' "$1" failed to find 'FFmpeg version N-[0-9]\+-' from an ffmpeg library.

The ffmpeg library must be compiled from chromium's source code.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vivaldi-ffmpeg-codecs has instructions that build libffmpeg.so from chromium source code.
Comment 12 Jeroen Roovers gentoo-dev 2018-05-03 14:25:17 UTC
(In reply to crocket from comment #11)
> Because `grep -aom1 'FFmpeg version N-[0-9]\+-' "$1" | cut -f2 -d-` is not
> in double quotes, when it is an empty string,

Yes yes yes.

> The ffmpeg library must be compiled from chromium's source code.

Like media-video/ffmpeg[chromium]? I am not sure what you're trying to add to the conversation now.
Comment 13 crocket 2018-05-04 00:01:38 UTC
As far as I know, media-video/ffmpeg[chromium] doesn't build libffmpeg.so from chromium's source code.

libffmpeg.so produced by ffmpeg's chromium USE flag is not useable by opera or vivaldi.
Comment 14 Joonas Niilola gentoo-dev 2018-06-08 06:49:38 UTC
(In reply to crocket from comment #13)
> As far as I know, media-video/ffmpeg[chromium] doesn't build libffmpeg.so
> from chromium's source code.

Nope, but chromium builds its libffmpeg.so from ffmpeg's sources. They do apply their own patches to it, though. 

> 
> libffmpeg.so produced by ffmpeg's chromium USE flag is not useable by opera
> or vivaldi.

It used to work. I guess chromium has somehow made it incompatible without their patches added. Havent studied this, but they may be portable to work with upstream ffmpeg using patches. I tried with ffmpeg-4 but it didnt work. No info about ffmpeg-9999.

Maybe add chewi@gentoo.org to CC here, since he's done all the work for ffmpeg[chromium]? 

Also see:
#654208 (chromium[system-ffmpeg] doesnt work) related to this one.
Comment 15 El Goretto 2018-08-02 12:09:57 UTC
Same issue here: hard replacement of libffmpeg.so provided by Vivaldi with media-video/ffmpeg[chromium] is a no go.
CC Chewi seems to be a good idea. For the record, last comment of chewi: https://gist.github.com/ruario/bec42d156d30affef655#gistcomment-2374195

http://gpo.zugaina.org/www-plugins/vivaldi-ffmpeg-codecs is not a reliable solution either as it is based on Arch Linux herecura repo which is synced with Arch Linux. For example it requires glibc 2.27 as of now (Gentoo Stable = 2.26).
Comment 16 GentooX 2018-11-26 00:08:38 UTC
I'm using "chromium-codecs-ffmpeg-extra" from Ubunutu's repositories to get H.264/MP4 working.

When I get a Vivaldi update and it breaks H.264/MP4 I download the latest one, extract it and copy libffmpeg.so to /opt/vivaldi/lib/
Comment 17 James Le Cuirot gentoo-dev 2018-12-02 22:11:34 UTC
Bah, there's so much confusion here, I wish someone had pinged me earlier.

You don't need the Chromium sources. I have just pushed a fix to the ffmpeg ebuilds (v4+ only) to make it work again. It won't work out of the box yet because jer stopped patching the launcher script a while back. For now, you'll need to manually set LD_PRELOAD to the libffmpeg.so path or symlink it from /opt/vivaldi/lib/libffmpeg.so.

jer, in terms of making this work in the browser, I think more caution is needed. 

The version check it does will never work because it's checking against the version used by Chromium (based on git commits) rather than the upstream ffmpeg version that our library has.

Just commenting it out is dangerous because it'll almost certainly break when the ffmpeg subslot/soname changes. I seriously recommend adding an ffmpeg dependency like "proprietary-codecs? ( media-video/ffmpeg:0/56.58.58[chromium] )" or you'll get problems that could include videos not working without warning, browser tabs crashing, and the browser segfaulting on startup. With the dependency in place, users can choose whether they would prefer to upgrade ffmpeg now or keep the videos working.

Using that approach, you can avoid patching altogether and just replace the libffmpeg.so file that gets installed with a symlink. I'm less bothered about this aspect though, I'd just like it to work while avoiding nasty breakages.
Comment 18 Perfect Gentleman 2019-05-01 17:55:44 UTC
Confirm the bug. Thwe workaround is delete /opt/vivaldi-snapshot/lib/libffmpeg.so and replace it with symlink of /usr/lib64/chromium/libffmpeg.so.
/opt/vivaldi-snapshot/lib/libffmpeg.so -> /usr/lib64/chromium/libffmpeg.so