All 3 entries tagged Firefox

View all 24 entries tagged Firefox on Warwick Blogs | View entries tagged Firefox at Technorati | There are no images tagged Firefox on this blog

July 26, 2016

Codec support for openSUSE Leap 42.1

Do you use openSUSE Leap 42.1? Do you want Twitter to stop displaying "This browser does not support video playback." when you're looking at it in Firefox? Do you want support for stuff like watching DVDs and H.264/ACC in an mp4 container in gstreamer (used by the GNOME Videos application (Totem), Parole and others)? Do you want to do these things without polluting your install by adding third party repositories and replacing packages provided by openSUSE? Do you want to do that stuff on a machine you don't have root on? If you answered yes to any of the previous questions, keep reading.

For some years I used to maintain machines running SUSE Linux Enterprise Desktop and rolled my own solution for adding codec support to them by way of a single package that doesn't conflict with anything provided by SUSE. (The last iteration can be found at https://www.suse.com/communities/blog/additional-multimedia-codec-support-sled-12/) Having installed openSUSE Leap 42.1 I found that the recommend method for adding codec support was a page which said something like "this isn't available for technical reasons try this other place" and that other place talked about the phonon backend with no mention of gstreamer. Then I decided to build my own solution for openSUSE too. You can get it by clicking Stuff to add codec support to openSUSE Leap 42.1


You need to read the README.txt file for full details, but to give you an idea of what’s involved, the build process is as follows:

$ ./build


It'll tell you if there are packages you need to install. Install those, then run the script again. By default the plugins will be built to live in /opt/multimedia If you want them to live somewhere else then change the line

prefix=/opt/multimedia;

to reflect where you want to put them. E.g if you want them in your home directory you could use

prefix="${HOME}/.multimedia";

By default an rpm will be built but if you set the prefix to something in your home directory the rpm won’t be built as it’s assumed you’re specifying your home directory as the prefix because you don’t have root and hence can’t install an rpm.

What the script basically does is build a bunch of gstreamer plugins, stick them somewhere they don't clash with what's in openSUSE packages, and put something in place so gstreamer can find them. Making Firefox play videos in Twitter rather than display the "This browser does not support video playback." is done by including ffmpeg, which Firefox will use for video playback if it's installed. (Far as I can tell, the significant file is libavcodec.so. The ffmpeg binaries like ffmpeg, ffserver etc are also included.)

There's nothing for hardware decoding of H.264 included. I have an Nvidia card and use the propriety Nvidia drivers. I can get hardware acceleration for H.264 by installing gstreamer-plugins-vaapi which is in the standard Leap 42.1 repos. Unfortunately installing it renders Totem unable to play H.264 video. It displays black for a few seconds than borks. The version of gstreamer-plugins-vaapi included in Leap 42.1 is 0.5.10. I found that 0.7.0 is the latest version that will build with gstreamer 1.4.5 that's included in Leap, but that didn't work any better for me. (Seems it did for this guy though https://blogs.gnome.org/ovitters/2015/12/23/hardware-accelerated-video-playing-with-totem/bl ). Parole, the XFCE video application, works though. It uses GTK and gstreamer and works fine in GNOME. If you want to get minimalist about it, you could also use gst-play-1.0

$ gst-play-1.0 --interactive video.mp4

February 05, 2010

Finding the path of a Firefox profile

The other day I found myself needing to be able to determine the path of a user's Firefox profile. It was one of those tasks that seemed very simple to start with but then got more complicated the more I thought about it. Some people have more than one Firefox profile. So it needs to be determined which one is the default, which requires working it out by looking at the user's profiles.ini file. profiles.ini may contain details of one or more profiles. If it contains details of more than one profile one of them will be marked as the default, but if there is only details of one profile it won't be marked as the default. If a profile is marked as default then the line which marks it as default isn't always in the same place in relation to the other information about the profile. The path to the profile that appears in profiles.ini might be relative to the location of profiles.ini, or it might not be. In the end I realised that rather than it being a case of writing a couple of lines in the script I was writing, it was a task best suited to being broken out in to a separate script which I can re-use in future.

Anyway, in the admittedly unlikely event that you've been looking for a way to find the path to a user's Firefox profile, here's a Script to find path of default or specified Firefox profile. It's written for Linux. It will probably work on other *nix systems (e.g. Mac OS X) by changing the value of $firefoxprofiledir and maybe making a few other tweaks.


June 17, 2008

Firefox 3, GTK and a downside of Enterprise Linux distros.

N.B. On 6/8/09 Novell updated Firefox in SLED 10 to version 3.0.12. They packaged up newer versions of GTK etc and supplied them as packages with names like firefox3-gtk2. I guess they got tired of backporting security fixes in to Firefox 2, or it became too difficult or just impossible to do anymore.


So Firefox 3 is released today. This is a Good Thing but also highlights a downside of using an 'Enterprise' Linux distro. The Linux version of Firefox has a dependency on the GTK toolkit and Firefox 3 requires GTK 2.10 or higher. If you're using a Linux distro that has an older version of GTK then Firefox pops up a message about how it needs GTK 2.10+ then exits. Given that part of the point of Enterprise distros is that they don't change things like library versions for years at a time, (thus providing a stability lacking in distros that release a new version every 6 months or so), this leaves anyone using a version of an Enterprise distro that has GTK older than 2.10 with something of a problem if they want Firefox 3. I am one such person as my main work machine runs Novell's SUSE Linux Enterprise Desktop 10, which has GTK 2.8.

There is of course a solution. (Aside from hoping that someone will release Firefox 3 packages for the version of your distro you're using, which for an Enterprise distro seems unlikley.) Get a new version of GTK and point Firefox 3 at it. Except it may not be that simple since GTK depends on various other libraries, possibly newer versions of those libraries than a distro with a version of GTK older than 2.10 includes. Anyway, this is how I got Firefox 3 running on SLED 10. It should be useful as a guide for other distros though some adaption may be required.

Install some packages

You'll need the following packages installed: openssl-devel, libjpeg-devel, libtiff-devel, libpng-devel. The versions that are included with your distro should do. The names may be slightly different if you're not using SLED 10. Debian and Ubuntu tend to use -dev rather than -devel in package names for example. There's probably other -devel packages you'll need apart from those I've listed and which I already had installed, but you'll find out if that's the case when you try and build stuff.

Download source code for GTK and dependencies.

These are the versions I used.:

Glib - http://ftp.gnome.org/pub/gnome/sources/glib/2.16/glib-2.16.3.tar.bz2
Cairo - http://www.cairographics.org/releases/cairo-1.2.6.tar.gz
Pango - http://ftp.gnome.org/pub/GNOME/sources/pango/1.20/pango-1.20.3.tar.bz2
ATK - http://ftp.gnome.org/pub/gnome/sources/atk/1.22/atk-1.22.0.tar.bz2
GTK - http://ftp.gnome.org/pub/gnome/sources/gtk+/2.12/gtk+-2.12.10.tar.bz2

I used Cairo 1.2.6 because it's new enough that Pango 1.20.3 will use it and old enough that it didn't require me to also build pixman.

Set some environment variables

I found I had to set the following environment variables to get the build to work. Note that the paths reflect where I installed the libraries so change to where ever you decide to install stuff.

$ export PKG_CONFIG_PATH=/local/opt/lib/pkgconfig:$PKG_CONFIG_PATH
$ export LD_LIBRARY_PATH=/local/opt/lib:$LD_LIBRARY_PATH
$ export PATH=/local/opt/bin:$PATH
$ export CPPFLAGS="-I/local/opt/gtk/include"
$ export LDFLAGS="-L/local/opt/gtk/lib"

Build and install

In the order they're listed above, unpack the source code, build and install. The build command is the same for all:

$ ./configure --prefix=/local/opt && make && make install

I installed the packages in to /local/opt since obviously I want to keep it all separate to the libraries that come with SLED 10, that's somewhere non-root users can write to on my machine and not doing this as root eliminates the chance of a typo overwritting already installed libaries. You may of course find some libraries don't build because you don't have some package or other installed so you may find you have to install a -devel package and try again. Edit: If something fails to configure or build then read the errors. Look at what libraries are mentioned then see if you have the -devel packages for those libraries installed. If not install them then try again. If you get an error about cups-config not being present then install the cups-devel package. Also read the comments and see if someone else had the same problem and a solution is suggested.

Make a wrapper script to run Firefox

You'll need to run Firefox via a wrapper script. This is what I use. If you're not using SLED 10 remove or alter the MOZ_PLUGIN_DIR value as appropriate. Replace /path-to-firefox/ with where you unpacked Firefox 3 and /local/opt with where ever you installed stuff.

#!/bin/bash
export LD_LIBRARY_PATH=/local/opt/lib
export MOZ_PLUGIN_PATH=/path-to-firefox/plugins:/usr/lib/browser-plugins
/path-to-firefox/firefox

Edit: I've just realised the MOZ_PLUGIN_DIR doesn't have any effect. I could have sworn that it did. Will have to look in to that.

Edit: Sorted out how to make Firefox 3 uses plugins in /usr/lib/browser-plugins and updated wrapper script.


Search this blog

Tags

RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder
© MMXXIV