The chromium snap ships FFMpeg codecs that allow decoding videos in many popular formats, including VP8, VP9, H.264 and Theora.
Other third-party browser snaps or snaps that embed a webview based on chromium may not be allowed to redestribute those codecs for legal reasons. For those, there is a chromium-ffmpeg content snap that exposes slots which snaps can connect to to see a copy of the desired version of
The provider declares several slots:
$ snap connections chromium-ffmpeg Interface Plug Slot Notes content - chromium-ffmpeg:chromium-ffmpeg-95241 - content - chromium-ffmpeg:chromium-ffmpeg-98516 - content - chromium-ffmpeg:chromium-ffmpeg-103551 - content - chromium-ffmpeg:chromium-ffmpeg-104195 -
Each slot has an FFMpeg version number in its name, which corresponds to a given chromium release.
- FFMpeg 95241 : chromium 77
- FFMpeg 98516 : chromium 84
- FFMpeg 103551 : chromium 93
- FFMpeg 104195 : chromium 94
A consumer snap needs to declare a corresponding plug in its
plugs: chromium-ffmpeg-103551: interface: content target: $SNAP default-provider: chromium-ffmpeg
Once the connection is made, the consumer will see
libffmpeg.so mounted at
$SNAP/chromium-ffmpeg/libffmpeg.so. By appending
LD_LIBRARY_PATH (or whatever other shared library loading mechanism the consumer uses to look up and load
libffmpeg.so), the codecs will be made available to the application.
To make the connection:
snap connect <consumer-snap-name>:chromium-ffmpeg-103551 chromium-ffmpeg:chromium-ffmpeg-103551
Note that consumer snaps that are in the store can request an assertion to be set up so that the connection will be made automatically when the snap is installed. To enable this, the maintainer of the snap should create a forum post in the store-requests category to make the case for the auto-connection.