Skip to content

Instantly share code, notes, and snippets.

@ruario
Last active March 18, 2023 11:17
Show Gist options
  • Star 94 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save ruario/bec42d156d30affef655 to your computer and use it in GitHub Desktop.
Save ruario/bec42d156d30affef655 to your computer and use it in GitHub Desktop.
How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library
@ruario
Copy link
Author

ruario commented Jun 12, 2020

@DanMan No that is incorrect. Vivaldi will not make use of that package. Vivaldi will fetch the files it needs itself and this document and steps are no longer relevant or valid.

@yenaras
Copy link

yenaras commented Oct 26, 2021

for kde neon, all I had to do was
sudo apt install ubuntu-restricted-extras

@ruario
Copy link
Author

ruario commented Oct 26, 2021

@brandon82890 Nope. That does absolutely nothing for Vivaldi whatsoever.

@yenaras
Copy link

yenaras commented Oct 26, 2021

If you say think so, but it worked for me. It installs the mp4 codecs and also the chromium-codecs-ffmpeg-extra.

https://packages.ubuntu.com/bionic/ubuntu-restricted-addons
https://en.wikipedia.org/wiki/Ubuntu-restricted-extras

@ruario
Copy link
Author

ruario commented Oct 26, 2021

@brandon82890 I am a Vivaldi employee and the person who wrote the code that Vivaldi uses to decide which lib to load to support more codecs. I am telling you that you are completely wrong. Sorry to be blunt.

Why am I so blunt? Because I do not want to sow more confusion amongst other users who might see your message and think this is a solution. It is not.

Vivaldi corrects the situation itself. On install (or startup if that fails) Vivaldi fetches a package in the background and installs a file from it to handle a wider variety of codecs. It will not look at any of the libraries in the packages you listed. Most likely you believe you fixed it because on first start the support file had not yet been fetched by Vivaldi. Vivaldi then initiated the process to fix the situation. You then installed what you thought was a package that would fix the situation. This had no effect at all but on restart, the file Vivaldi fetched was then used. Remove ubuntu-restricted-extras and associated dependencies and you will find that Vivaldi still works.

@yenaras
Copy link

yenaras commented Oct 26, 2021

Oh wow, you're right, I did sudo apt remove ubuntu-restricted* and then restarted the browser. It still works fine. Sorry for the misinformation. It must have been a coincidence like you said.

@MDAR
Copy link

MDAR commented Jul 28, 2022

@ruario

Vivaldi corrects the situation itself. On install (or startup if that fails) Vivaldi fetches a package in the background and installs a file from it to handle a wider variety of codecs. It will not look at any of the libraries in the packages you listed. Most likely you believe you fixed it because on first start the support file had not yet been fetched by Vivaldi. Vivaldi then initiated the process to fix the situation. You then installed what you thought was a package that would fix the situation. This had no effect at all but on restart, the file Vivaldi fetched was then used. Remove ubuntu-restricted-extras and associated dependencies and you will find that Vivaldi still works.

Would you be kind enough to ask your team to look into why Vivaldi on DietPi V8.7 (Debian based) on an Odroid C4 doesn't load the required files in order to play H.264 videos?

I have restarted the app a number of times and still get the same message.

Re - MichaIng/DietPi#5300

I have had to look for an alternative to Chromium because we just can't get it to run in a kiosk mode in an Xinit session any more.
Something upstream has been changed and now all we get is "Stack Smashing"

Vivaldi loaded and ran perfectly without any issues, other than the H.264 playback.

I'm happy to try anything your team suggests.

@ruario
Copy link
Author

ruario commented Aug 1, 2022

@MDAR I know why H.264 is failing for you and hope to get out a fix soon. In the mean time I can give you a work around.

If it is armhf

wget -O- https://launchpadlibrarian.net/614082413/chromium-codecs-ffmpeg-extra_103.0.5060.134-0ubuntu0.18.04.1_armhf.deb | tail -c+1157 | tar xOJ ./usr/lib/chromium-browser/libffmpeg.so > libffmpeg.so.5.3
sudo install -m755 libffmpeg.so.5.3 /opt/vivaldi/libffmpeg.so.5.3

If it is arm64

wget -O- https://launchpadlibrarian.net/614041844/chromium-codecs-ffmpeg-extra_103.0.5060.134-0ubuntu0.18.04.1_arm64.deb | tail -c+1157 | tar xOJ ./usr/lib/chromium-browser/libffmpeg.so > libffmpeg.so.5.3
sudo install -m755 libffmpeg.so.5.3 /opt/vivaldi/libffmpeg.so.5.3

@MDAR
Copy link

MDAR commented Aug 1, 2022

Thanks @ruario

wget -O- https://launchpadlibrarian.net/614041844/chromium-codecs-ffmpeg-extra_103.0.5060.134-0ubuntu0.18.04.1_arm64.deb | tail -c+1157 | tar xOJ ./usr/lib/chromium-browser/libffmpeg.so > libffmpeg.so.5.3
sudo install -m755 libffmpeg.so.5.3 /opt/vivaldi/libffmpeg.so.5.3

That certainly works with an Odroid C4 to get the video to load and be manually played.

In chromium, there is a setting I need to adjust in order for it to AutoPlay.

Settings
Privacy
Sound = Allow

I have checked that this setting is ON in Vivaldi, but the video won't autoplay, if a websocket command is received to load and play a video.

Videos will play if I click on the Play button (as per your test page)

I'm very happy to open a port so you can access the machine I am generating the content with.

FYI
I'm trying to get this working, with Vivadli instead of Chromium
https://youtu.be/FinliWWOBOU?t=157

Best wishes,
Stuart

@MDAR
Copy link

MDAR commented Aug 1, 2022

@ruario

Small update.

If I start the browser in kiosk mode, it will display the video, but NOT play it.

Until

I press F11 Twice

After that, it behaves perfectly.

The only issue is that I can't automate that button press

Have you any ideas on how I can get around this?

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