DRM/Codec library issues when building custom flatpak (Vivaldi Browser)


I’m trying to build Vivaldi into a flatpak but I’m running into some issues with libffmpeg.so and libwdievine.so

When I try to run the browser it works fine besides playing test videos that contain DRM / mp4 because they need either one of the libraries mentioned above.

For widevine I get this in the output of the application:
[171:72:0516/114344.256416:ERROR:cdm_module.cc(139)] CDM at /var/home/…/.var/app/org.vivaldi.browser/config/vivaldi-beta/WidevineCdm/4.10.2209.0/_platform_specific/linux_x64/libwidevinecdm.so could not be loaded.
[171:72:0516/114344.257907:ERROR:cdm_module.cc(140)] Error: /var/home/…var/app/org.vivaldi.browser/config/vivaldi-beta/WidevineCdm/4.10.2209.0/_platform_specific/linux_x64/libwidevinecdm.so: cannot open shared object file: Operation not permitted

For libffmpeg.so, as was said in the request for this to be flatpacked it requries LD_PRELOAD and the path to the library appended to it. Can this work with the current implementation of zypak?

I also tried to use the add-build-extensions to include the org.freedesktop.Platform.ffmpeg-full but I don’t believe the libffmpeg.so is included in that.

Any help on these two would be great. The YAML file I wrote is really ugly so I"m sort of bashful on sharing it but I can if that is needed.

Have you installed the libwidevinecdm.so.so files? see:

1 Like

Thanks so much for the reply, I have tried including the libwidevinecdm.so before and I don’t know if it worked or not because I think my first problem is making sure the ffmpeg library is connected first through LD_PRELOAD.

I have a testing repository on github under my account with just libffmpeg.so being installed and then I’m trying to go to non-DRM mp4’s and get them to play. That hasn’t worked so far.

snugglej/org.vivaldi.Vivaldi: This is a testing repository for a flatpak on Vivaldi

I was told zypak probably is where my problem lies and I need to take some time to troubleshoot that.

There’s update-widevine and update-ffmpeg scripts in the .deb file. We need to change paths. when run with --user it installs to

if [ "x${1-}" = "x--user" ]; then

Either you can run the script when vivaldi is run using wrapper script, or download the .so files and include them in the flatpak.

1 Like

Thanks for your feedback and helpful suggestions. Really appreciate all your help on the repo.