Skip to content

Instantly share code, notes, and snippets.

@p-ja
Last active May 8, 2025 06:17
Show Gist options
  • Save p-ja/367c0c7672284afa03e7f15d71422884 to your computer and use it in GitHub Desktop.
Save p-ja/367c0c7672284afa03e7f15d71422884 to your computer and use it in GitHub Desktop.
libffmpeg.so setup for Opera on Linux

How to fix not working videos in Opera on Linux

Assumptions

  • You're using Ubuntu (and maybe other distros using apt and snap)
  • Opera is installed using deb from https://download.opera.com
  • chromium-ffmpeg lib is installed using snap
sudo snap install chromium-ffmpeg

Fix

To link the ffmpeg lib in Opera, run

sudo ./sudo_setup_opera_ffmpeg.sh

REMEMBER: ALWAYS CHECK SCRIPTS FROM THE INTERNET BEFORE RUNNING THEM (especially with sudo)!!!

#!/bin/bash
# Check for root privileges
if [ "$EUID" -ne 0 ]; then
echo "Error: Please run as root (sudo)"
exit 1
fi
# Find Opera binary
OPERA_PATH=$(readlink -f $(which opera 2>/dev/null) || { echo "Error: Opera not installed"; exit 1; })
OPERA_DIR=$(dirname "$OPERA_PATH")
# Find FFmpeg library
FFMPEG_PATH=$(find /snap/chromium-ffmpeg/ -name libffmpeg.so 2>/dev/null | sort | tail -n 1)
if [ -z "$FFMPEG_PATH" ]; then
echo "Error: FFmpeg not found. Install with: snap install chromium-ffmpeg"
exit 1
fi
FFMPEG_TARGET="$OPERA_DIR/libffmpeg.so"
# Backup if exists
if [ -f "$FFMPEG_TARGET" ]; then
BACKUP_DATE=$(date +%Y%m%d)
mv "$FFMPEG_TARGET" "${FFMPEG_TARGET}.bak_${BACKUP_DATE}"
fi
# Create symlink
ln -sf "$FFMPEG_PATH" "$FFMPEG_TARGET"
@LorenzoLamberti94
Copy link

thanks man :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment