Firefox won’t play MP4 files

I noticed after Chrome stopped working in Linux and I switched back to Firefox 71, that FF would not play a lot of videos or GIFs. This was true on some YouTube videos, all of Vimeo, and even locally opened MP4 (h264 with AAC audio, or h265, either HD or 4K) files I made. These files play fine on VLC. Apparently there is some kind of patent issue with MP4, and it would require that they pay something to the patent holder. Here is a link to the Mozilla page that alludes to this:
https://support.mozilla.org/en-US/kb/html5-audio-and-video-firefox

This may also relate to the problem I’ve seen with animated gifs, but I’m guessing.

It would have been nice for them to simply state that Firefox will not play MP4 files.

corrupt

It isn’t related to plugins or adblockers. I dug around for a few hours reading various suggestions from years ago all the way up to a few months back. There were several saying “Oh, just clear your cache and cookies”. Bullshit! This has to do with FF not knowing what to do with a particular format.

I recompiled ffmpeg and a bunch of libraries, but that didn’t help Firefox. I hate that I have to guess at why the latest version of a modern browser can’t play common video types. If Mozilla would state exactly why they won’t play certain types of files on their knowledgebase, that would be helpful. Or tell us what steps to take to enable the browser to play those files. As I said, other programs on the same computer play them with no problems, that reduces the issue to Firefox.

I purged and reinstalled Firefox entirely using these steps:


sudo apt purge firefox

sudo rm -rf .mozilla

sudo rm -rf .macromedia [remove vintage Flash player stuff. May not exist.]

sudo rm -rf .adobe [remove vintage Flash player stuff. May not exist.]

cd .cache
Delete the mozilla folder

cd /etc
sudo rm -rf firefox

cd /usr/lib
sudo rm -rf firefox
sudo rm -rf firefox-addons

Reboot your computer to get rid of any temporary files.

sudo apt install firefox

Firefox still is not able to play MP4 files. Ridiculous!

I also checked the steps in this StackOverflow posting and it made no difference, Firefox still insists that all MP4 files are “corrupt”.

Chrome won’t open in Ubuntu

UPDATE 12-27-19: The issue of Chrome not opening seems to be related to two files called “Preferences” and “Network Persistent State” (maybe just Preferences) found in the home hidden directory .config/google-chrome/Default/ If I set these two files to be owned by root and not writable by my own login, then Chrome will open, but will not remember any extensions or settings I configured the last time I used Chrome. If I set the same files (via chmod and chown) to my login and permissions to read+write, then Chrome will not open. I just see the spinner on my cursor indicating it is trying to open, but then I have to kill the process via terminal. I sent this info to the Chrome developers via a popup in Chrome when it couldn’t read my Preferences.

UPDATE: Still no real explanation for why Chrome works fine for several months and then stopped. Also, no explanation for why some of these “fixes” work once or twice and then stop. If I start with a completely new profile, it will work again for a while. This makes me think there is some setting that is being changed that breaks it, but no idea what since it works fine and then suddenly won’t open.

Well, my “fix” worked once before doing the same behavior again. I have to find the process and harshly kill it.
ps -A|grep chrome
kill -9 process number

jw@JW-PC:~$ ps -A|grep chrome
9855 ? 00:00:00 chrome
9864 ? 00:00:00 chrome
9868 ? 00:00:00 chrome
9888 ? 00:00:00 chrome
9891 ? 00:00:00 chrome
jw@JW-PC:~$ kill -9 9855

I set my environment variable “MESA_GLSL_CACHE_DISABLE=true”, based on a Debian bug site statement, and that worked one time for opening Chrome. Thereafter it reverted to not opening at all. Frustrating!
To set the environment variable type this:
export MESA_GLSL_CACHE_DISABLE=true

Another site said to start Chrome via terminal and type
google-chrome --disable-gpu --disable-software-rasterizer

That worked a few times, but then gave the error
ERROR:gpu_channel_manager.cc(450)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.

So I tried various other option flags that worked for others, but no luck for me.

(Original Post)
Recently Chrome began acting up on my system, as in it simply would not open. The process was running, but it would not display. If I ran google-chrome from a terminal, I saw an error about sandboxing:
ERROR:sandbox_linux.cc(372)] InitializeSandbox() called with multiple threads in process gpu-process

I used Firefox to go online and search for the error. I found a Debian bug site that mentioned that changing the configuration of the mesa graphic drivers could help. I was not able to find a config file for these drivers, but found that I could add the repository for the drivers and get the latest version. That fixed it for me.

Here is the site with info on adding the repository:
http://tipsonubuntu.com/2019/02/08/install-mesa-graphics-driver-18-3-3-ubuntu-18-04/

I went from version 19.0.8 to 19.2.1 and Chrome opened right up. Wish I’d seen this fix before blowing away my old profile…