How to copy the OSX Lion installer to prevent multiple downloads

Apple’s OSX Lion upgrade is available from the App store as an almost 4GB download, and a single purchase can update all your computers running Snow Leopard. My concern was that I didn’t want to have to download it twice for each Mac I have, but fortunately it’s very easy to make a copy after …

Read more

Categories OSX

Join video files together on Mac with cat and mencoder

I have a whole bunch of short avi files (not sure what format they actually are, but the extension is .avi) and needed to join them together quickly and easily so the 3 year old could watch some TV without bothering me every 5 minutes to start the next one 🙂 This post shows how to do this from the command line with the cat and mencoder commands

Get mencoder

It looks like you can download mencoder as part of the mplayer package here, but I’m not really sure about that. I use the PS3 media server app which includes mencoder so I used that.

Concatenate the files

Open up Terminal (Applications -> Utilities -> Teminal) and use the “cat” command to join the files into one great big file. Let’s say the files are in your Downloads folder, they’re all named something.avi and there are no other .avi files in the folder. Do this:

cd ~/Downloads
 cat *.avi > combined.avi
 

They’re now in one big file, but if you play the combined media file it will only play the first video in it. That’s because there’s header information which tells the media player it’s only X minutes long, so it will stop playing then. We need to use mencoder to fix the header.

Use mencoder to fix the file so it plays them all

So for me, mencoder is at /Applications/PS3 Media Server.app/Contents/Resources/Java/osx/mencoder Unless you use PS3 Media Server then it’ll be somewhere else. I’ll leave it up to you to work out where it is…

Replace “mencoder” in the following command with the full path to your mencoder. If there are spaces anywhere in the path, you need to put quotes around it. So for me, mencoder = ‘/Applications/PS3 Media Server.app/Contents/Resources/Java/osx/mencoder’

mencoder -forceidx -oac copy -ovc copy combined.avi -o fixed.avi

combined.avi is the name of the combined file we created at the “cat” step above. fixed.avi is the name we want to name the final file that works. Change that to the actual name.

ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

As mencoder writes the file it will show a percentage counter. I’ve found once it gets to 100% you start seeing stuff like this:

Writing header...
 ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
 Writing header...
 ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
 Pos:2868.0s71702f (100%) 4195.31fps Trem:0min 565mbA-V:0.000 [1523:128]
 Skipping frame!
 Pos:2868.1s71703f (100%) 4195.37fps Trem:0min 565mbA-V:0.004 [1523:128]

At this point, as far as I can tell, it will do this forever. Just hit Control + C to cancel. The file (named combined.avi in my example above) is there and works from my experience.

Voila, all done! Enjoy your joined video!!

Categories OSX

Remove input shadows on iOS devices

One thing I’ve found annoying with the mobile Safari browser on iOS is the shadows that appear at the top of input boxes. It’s not normally too much of an issue unless you are doing fancy styling and then they can make it really messy and ugly. Fortunately David Walsh has provided a solution. I won’t repeat the solution but do post some screenshots here showing the issue and how much better it can look after applying his fix.

Categories OSX

Showing seconds with ls on Linux and OSX

Using the "ls" command to list directory contents from the command line with the -l flag will include the date and time down to the minute, but not show the seconds. This post shows how to display the seconds as well with bash on Linux and OSX.

How to shrink a VMWare Fusion Linux virtual disk

VMWare Fusion on Mac OSX allows you to shrink virtual disks easily for Windows virtual machines right from the graphical interface (Virtual Machine -> Settings -> General -> Clean Up Virtual Machine) but there isn’t the same option to do this with Linux, so you need to do it from the command line.