Ph.D Researcher in Software Engineering and Human Factors of Computing

Tag Archives: mac

Are you always using hard disks and USB keys in your Mac? Getting annoyed with having to go to the Finder, scrolling down in the sidebar, and then ejecting these disks before you can unplug all of these devices to move your computer? Or, maybe you just pull out the USB and let Mac OS X complain at you about how the disk was removed without you ejecting it first?

Try using this AppleScript along with a launcher application like QuickSilver to save time and eject all of your disks with one command! A launcher application is basically a quick way to start up applications – you press a keystroke like “Ctrl-Space” and then begin typing, and QuickSilver will find applications that match what you’ve typed. Ejecting disks is quite literally at your fingertips.

Save it into a place you’ll find it later. I used ~/Library/Scripts and called the script “EjectAll.scpt”.

Compile it!

Now, if you double-click on that script, it’ll automatically eject all of your media and give you a dialog box to let you know when it’s finished.

QuickSilver Catalog Preferences Window

In QuickSilver, I added the ~/Library/Scripts directory to my catalog by opening the QuickSilver Preferences, clicking on Catalog, then going to Scripts in the sidebar. I then ensured that “Scripts (User)” was checked.

Then, you can relaunch QuickSilver, press its hotkey (Ctrl-Space by default), and type “EjectAll” and press enter to run the script. It’ll automatically eject all of your media and then you can pull out all of your plugged-in devices without worry!

I’ve been getting a bit into the habit of taking camcorder footage of things that I go to now, editing them in iMovie’09, and then posting them on Facebook and YouTube.

However, I’ve had some issues trying to transfer video from an HD camera I’ve borrowed, the JVC Everio GZ-HD7U. It’s a handy camera with a large hard drive and a decently-long lasting battery, but it’s not very compatible with iMovie — if you connect it to a Mac and try to import the movies, it simply doesn’t let you import them directly.

I’ve tried a few things, mostly transcoding with ffmpegX, but every time I did so it resulted in really bad motion artifacts that band across my movie. Today, I finally discovered a good compromise and the solution is actually much easier than I would have thought.

The short answer:

ffmpeg -i infile.mpg -target ntsc-dv outfile.dv

The expanded answer is that even though the camera records internally as MPEG-TS, it’s in some kind of compressed format and needs to be transcoded. The way that I do this is:

Plug the camera into my computer using the USB Cable.

Turn on the camera.

Using the camera’s options, select “Back up onto PC”. The camera will mount itself as a drive on the computer. The drive layout will probably vary based on what you’ve been recording, but in general it’s laid out with a bunch of directories named PRG000, PRG0001 and so on.

Within these directories, copy all of the .TOD files onto your hard drive.

Once the files are on your hard drive, export them to DV format using the ffmpeg command: ffmpeg -i infile.mpg -target ntsc-dv outfile.dv

If you don’t have ffmpeg installed on your Mac, you can do it with MacPorts (type sudo port install ffmpeg and ports should do the rest*).

I hope this helps some of you!

NOTE:
Using this method converts stuff into standard NTSC resolution (apparently, I don’t know enough about video transcoding). Now, the “original” movies are filmed at 1920×1080 (HD 1080) resolution, but if I copy the TOD files onto my computer and play them, I get nice funny artifacts. This leads me to suspect that the camcorder’s compression kind of plays tricks on playback or something – makes it seem like they’re HD1080 when the files are in fact not even close to that. So the issue of course is that when you use the DV output format with ffmpeg, you end up scaling your movies down to 720×480. The odd thing for me is that the movies are still widescreen. I don’t know how this works or if some programs are fooled and all I truly do know is that the movies look better. But, this leads me to believe that if you buy a camcorder that says “full HD” it might actually not be full HD even if it claims that it can film in 1920×1080 resolution.

Just my two cents, if anyone can help fill me in on video formats please let me know.

* I did have a problem with installing from ports, and it was due to an outdated gettext Perl module. What I ended up needing to do was to delete all of my ports and recompile. I am suspecting the issue was because I installed all of my ports on Leopard, and upgrading to Snow Leopard without recompiling all of the ports caused problems.