I do a lot of video and audio conversion for my Ipod. And almost aways, my conversion program (ffmpeg), hogs up my CPU for the entire time with 100%CPU and manages to heat it upto 80 degrees (C). I have seen as high as 85.
Finally, thought there must be some ways of handling it apart from just nicing it or renicing it. Here are the tools I found out.
Ubuntu
Well, I always had this applet “CPU Frequency Scaling Monitor” through which I can run my processor at specified frequencies. But that never impressed me. As this just slows my processor, the bully process still hogs it leaving other processes thirsty. Of course, this is helpful for controlling temperatures if I am doing a long video or a movie. But definitely not my type.
Oh, If you are wondering about the frequency selector thing, it isn’t available by default. Follow this link, to enable frequency selecting. Just click on applet and chose your frequency. Again this might be just available for laptop processors. (?) But I don’t see the point here running your power house at lower speeds.
Anyways, what ever I was looking for Synaptic had it.
Its a small cutely cudly thingy proudly called “cpuLimit”. Just grab a terrminal and install it. sudo apt-get install cpulimit
I don’t know how it does it neither I could find out. It could be dynamically *nicing* the process to achieve average percentage CPU usage for small time slices. The *limiting effect* is pretty instantaneous. Anyways, all I have to do is,
sudo cpulimit -p pid -l 25
.. and the busy bully just tamely runs at 25% CPU. ZZZactly, what I wanted. CPU runs at normal speeds. (I use OnDemand). Other processes get the water they need, Everyone’s happy. Me too. Movie getting converted at 15% CPU on 4th workspace as my amarok plays BT and I writes my blog.
Anyways, Here’s the cuty.
Windows
Being a windoos user at Office, looked up some tools for Windows as well.
- ProcessTamer – Download of Day @ Lifehacker
- SpeedswitchXP – Frequency Selector for Windows.
- Process Lasso – Looks a better bet.
iPod Tip of the Day
Slow and best:
ffmpeg -i videoFile1.avi -f mp4 -vcodec libxvid -maxrate 1500k -b 1150k -qmin 3 -qmax 5 -bufsize 4096 -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -g 300 -ar 48000 -ab 192k -s 640x352 -aspect 16:9 Output.mp4
Fast and Simple:
ffmpeg -i temp.avi -ab 292k -ar 44100 -b 2000k -r 25 -s 640x480 temp1.mp4





December 12, 2007 at 5:17 am
wonderful. ipod trick is good and best among all is the cpulimit tool discovery..
February 23, 2008 at 7:34 pm
thanks, so useful.
June 18, 2008 at 12:04 pm
man….u made my day…seriously a hugeeeee THANKS!
June 20, 2008 at 10:12 pm
For Windows you can also set the priority lower in Task Manager; seems to work for me
August 5, 2008 at 3:38 pm
I do what Bryan does. Why so much trouble when it’s an inbuilt option? I haven’t tried but maybe you get more with those apps…
February 6, 2009 at 1:45 am
Bryan, priority is not the same as CPU limit. A task will use 100% of the CPU even if it has the lowest priority as long as not other task is using CPU time.