I wanted to share an .mp4 file on my webserver but Firefox didn’t play it. It turned out Firefox prefers the .webm and .ogv formats, while Chrome can play .mp4.
Convert mp4 then:
.mp4 to .webm
ffmpeg -i input.mp4 -vcodec libvpx -acodec libvorbis -b:v 600k -cpu-used 4 -threads 8 output.webm
To change the quality, play with the “600k” value (bitrate).
.mp4 to .ogv
ffmpeg -i final.mp4 -vcodec libtheora -acodec libvorbis -b:v 600k -cpu-used 4 -threads 8 final.ogv
Here the difference is the codec (libtheora instead of libvpx).
Maybe I missed something, but the .webm file seemed to me to have better quality than .ogv. So I think it’s enough to support two formats only: .mp4 for Chrome and .webm for Firefox. By the way, in my test the input file (.mp4) had the best quality and smallest filesize, but again, I may miss something.
And here is an HTML5 code that can play your video:
<video controls preload="metadata" width="1024" height="768" poster="images/front.jpg"> <source src="video.mp4" type="video/mp4"> <source src="video.webm" type="video/webm"> <p>Please use a modern browser to view this video.</p> </video>
I knew that Firefox could do synchronization with multiple machines but I never tried it. It changed today. I got fed up with the manual sync so I looked after it and found this nice description of the process: https://support.mozilla.org/en-US/kb/sync-your-add-ons-another-copy-firefox . For this you need a free Firefox account.
List of Firefox shortcuts: https://www.accessfirefox.org/Firefox_Keyboard_and_Mouse_Shortcuts.html .
- Re-open closed tab: Ctrl + Shift + T
I love Firefox but I suffered a lot recently because of its slowness. It ate up my CPU and thus it became very slow. I even started to use Chrome parallely with some sites where Firefox was very slow. Strangely, Chrome was much faster on certain sites. How to speed up my Firefox?
It turned out that it became slow because of one (or more) add-on(s). The best way to speed up your Firefox is to disable ALL your add-ons. Now I’m enabling just some add-ons that I really need, but I do it one by one, and monitor Firefox if it’s still fast or not.
With my add-ons disabled Firefox has become very fast, like Chrome. I should have done it much earlier…
At my workplace I found two interesting links that I decided to read at home. I didn’t want to save their URLs and e-mail them to me, so I made a search if there is a good “read it later” add-on for Firefox. And then I got surprised.
So I put its icon next to my search bar and started to use it. It’s awesome! It also has a mobile app. so I can read the saved articles anywhere.
Hmm, I’m sure there are lots of other gems in the softwares that we use on a daily basis and we have no idea about them…
To view the generated HTML source in Firefox, use this bookmarklet:
This tip is from here.
I have an older dual core laptop where Firefox sometimes uses 120%-130% CPU and slows down the machine completely. Restarting Firefox solves the problem for a few minutes but then again, it eats up the CPU. What to do?
I don’t have many tabs open but I still have this problem. I also uninstalled the Flash plugin but it didn’t solve the problem.
However, I found a nice tool called cpulimit:
“Cpulimit is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time). It is useful to control batch jobs, when you don’t want them to eat too many CPU cycles. The goal is prevent a process from running for more than a specified time ratio. It does not change the nice value or other scheduling priority settings, but the real CPU usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly. The control of the used CPU amount is done sending SIGSTOP and SIGCONT POSIX signals to processes. All the children processes and threads of the specified process will share the same percentage of CPU.” (from the README of the project)
The following setting worked for me:
$ cpulimit -l 80 firefox
Firefox uses several threads but as mentioned in the documentation, they will will share the same percentage of CPU.
The CPU usage may jump higher than the specified value, but
cpulimit will push it back in a few seconds.
My old laptop has become useable again :)
Update (with Dropbox)
I noticed that Dropbox also loves my CPU. Here is how I could limit this greedy beast. Originally, I started “$HOME/.dropbox-dist/dropboxd” automatically at each startup. Create the file “$HOME/bin/cpulimit_dropboxd.sh” with the following content:
#!/usr/bin/env bash cpulimit -l 50 $HOME/.dropbox-dist/dropboxd
Make it runnable (
chmod u+x cpulimit_dropboxd.sh) and call this script (
cpulimit_dropboxd.sh) when your system comes up. Here I give 50% CPU for Dropbox but you can play with that value.