accelerate lame mp3 conversion 30. Apr 2011

If you have to handle a large number of audio files with the lame mp3 encoder you will want to accelerate the conversion process. Since lame doesn’t natively support multithreading, I decided to use GNU parallel. First I tried the default setting:

ls | parallel lame -V0 {} ../Output/{}

This spawns 9 processes and gave me an acceleration of 1.5x. Then I tried using more processes to see if I could further accelerate the process:

ls | parallel -j 12 lame -V0 {} ../Output/{}

This gave me an acceleration of 1.7x, which is quite nice. I guess you’ll just have to play around to find the “magic value”.

 

download videos from vimeo 17. Apr 2011

Check out this shell script for downloading videos from Vimeo.

 

download the daily show 17. Apr 2011

Check out this shell script for downloading episodes of The Daily Show.

 

my personal mac osx cli utilization 16. Apr 2011

I was curious to see how much of the Mac OS X 10.6 CLI I actually used so I did a little statistical evaluation. The Method was simple, I counted the number of programs in /bin, /usr/bin, /sbin and /usr/sbin which I had previously used. The results roughly correspond to my expectations. The /bin directory had of course by far the highest percentage, followed by the /usr/bin directory and the system program directories.

In the /bin directory I have used 21 of 37 programs, which yields to 57% utilization. In the /usr/bin directory I have used 125 of 1093 programs, which yields to 11% utilization. In the /sbin directory I have used 6 of 65 programs, which yields to 9% utilization. And finally in the /usr/sbin directory I have used 12 of 235 programs which yields to 5% utilization. In total I have used 164 of 1430 programs yielding to 11% utilization and for the sake of completition here is the list of programs I have consciously used in my 7 years Mac OS X usage history:

/bin: bash cat chmod cp date echo hostname kill link ln ls mkdir mv ps pwd rm rmdir sh sleep test unlink

/usr/bin: SetFile alias ant arch at autoconf automake autoreconf awk cc chgrp crc32 crontab curl cvs defaults desdp diff dig dscl du egrep emacs env erb fc file find ftp gcc gcc-4.0 gcc-4.2 gdb gem git glibtool glibtoolize gnumake grep gunzip gzip head hexdump host iconv iosnoop iotop irb jar java javac killall ld less locale locate login logname mail mailq make man manpath more mvn nice nohup nslookup open openssl osascript otool passwd patch perl php printenv printf purge python rails rake rdoc renice ri rsync ruby say scp screen sed sftp shasum sqlite3 ssh strings su sudo svn svnadmin svnserve sw_vers swig tail tar tee telnet tidy time top touch tr uniq unzip uptime vi vim wait wc whereis which whoami xargs yacc zip

/sbin: ifconfig md5 mount ping reboot umount

/usr/sbin: chown diskutil dtrace htdigest htpasswd httpd lsof screencapture system_profiler tcpdump traceroute visudo

 

dumping an rtsp mp4 stream 15. Apr 2011

One way to dump an rtsp mp4 stream on Linux or Mac OS X is to use VLC:

cvlc --sout=file/mp4:video.mp4 --rtsp-tcp rtsp://stream.mp4

An alternative is to use MPlayer:

mplayer -dumpfile video.mp4 -dumpstream rtsp://stream.mp4

For this to work you’ll need to have it compiled with Live555 suport. You can also try your luck with openRTSP:

openRTSP -4 rtsp://stream.mp4 > video.mp4

If you install Live555 via MacPorts then you won’t find the binary in your regular path, instead it’s nested in the library folder:

/opt/local/lib/live/testProgs/openRTSP
 

1 2 3 4 5 6 ... 19