Using chromium-ffmpeg in third-party browser snaps

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 redistribute 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 libffmpeg.so.

The provider declares several slots:

$ snap connections chromium-ffmpeg
Interface  Plug  Slot                                    Notes
content    -     chromium-ffmpeg:chromium-ffmpeg-108372  -
content    -     chromium-ffmpeg:chromium-ffmpeg-111306  -
content    -     chromium-ffmpeg:chromium-ffmpeg-114023  -

Each slot has an FFMpeg version number in its name, which corresponds to a given chromium release.

  • FFMpeg 108372: chromium 105
  • FFMpeg 111306: chromium 114
  • FFMpeg 114023: chromium 121

A consumer snap needs to declare a corresponding plug in its snapcraft.yaml file:

plugs:
  chromium-ffmpeg-111306:
    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 $SNAP/chromium-ffmpeg to 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-114023 chromium-ffmpeg:chromium-ffmpeg-114023

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.

3 Likes

Updated the documentation as there is a new major version of chromium (69) with its corresponding FFMpeg revision (92142).

Updated the documentation as there is a new major version of chromium (70) with its corresponding FFMpeg revision (92393).

Updated the documentation as there is a new major version of chromium (73) with its corresponding FFMpeg revision (93464).

Updated the documentation as there is a new major version of chromium (74) with its corresponding FFMpeg revision (94142).

Updated the documentation as there is a new major version of chromium (77) with its corresponding FFMpeg revision (95241).

1 Like

@oSoMoN is some user action needed after installing both chromium and chromium-ffmpeg or does it work automatically?

The chromium snap doesn’t need chromium-ffmpeg, it already contains the codecs.

1 Like

Updated the documentation as there is a new major version of chromium (84) with its corresponding FFMpeg revision (98516).

1 Like

@oSoMoN will you be posting new versions of chromium-ffmpeg soon?

Yes, I’m working on updates, sorry for the delay.

Updated the documentation for a new major version of chromium (93) with its corresponding FFMpeg revision (103551).

1 Like

Updated the documentation for a new major version of chromium (94, currently in the beta channel) with its corresponding FFMpeg revision (104195).

Updated the documentation for a new major version of chromium (96) with its corresponding FFMpeg revision (104707).

1 Like

Hi, what would be the revision for chromium 98?

Updated the documentation for a new major version of chromium (100) with its corresponding FFMpeg revision (106454).

I see that the latest Opera Developer (89.0.4415.0) needs libffmpeg 107578 (the version of libffmpeg found in in Chromium 102 and 103). Could we get the chromium-ffmpeg snap updated to include 107578, so that proprietary media works here as well?

1 Like

Updated the documentation for a new major version of chromium (103) with its corresponding FFMpeg revision (107578).

1 Like

Hi oSoMoN, I just refreshed my snaps and it states that there’s no updates available but when I checked on what files were installed I found that the revision 107578 is not there. The latest one is still chromium-ffmpeg-106454. May I ask for you to upload 107578 again, please? Thanks in advance! Cheers

What revision of the chromium-ffmpeg snap is installed?

What’s the output of snap connections chromium-ffmpeg ?