Monday, June 8, 2009

Safari 4.0 how to turn off Top Sites and reclaim CPU cycles

Safari 4.0 is out and it steals a lot of CPU if you're not careful. There's a process called Safari Webpage Preview Fetcher which grabs sites for Safari to take screenshots of in the background for Top Sites.

The problem is this background process can eat up to 10% of your CPU when it's running or more. This isn't good when you need every ounce of power out of your Mac while you render or perform Multiclip edits in FCP.

Worse still, is there is a folder at ~/Library/Caches/com.apple.Safari/Webpage Previews which will fill up with .png and .jpeg screenshots of websites you visit (or don't visit but have bookmarked). Not only is this a security risk, (it'll take screenshots of your web email) but it's messy, can eat up a LOT of hard drive space and keeps backup software needlessly busy.

Here's how to stop all this from happening.

Keep in mind Safari 4.0 only came out a few hours ago so this "fix" hasn't been tested in the long term. I'm trying it right now and so far things seem okay. The only caveat seems to be some sites never finish "loading" because they never have a screenshot taken of them. They do complete loading but you'll see spinning gears on some of their tabs.

1. Quit Safari 4.0 and right-click on it's icon in the Finder. Select "Show Package Contents".
2. Look inside the Contents folder and right-click on Safari Webpage Preview Fetcher and select Compress "Safari Webpage Preview Fetcher".
3. Put the original Safari Webpage Preview Fetcher in the trash and empty it.
4. Navigate to ~/Library/Caches/com.apple.Safari/Webpage Previews and highlight it. Get Info on it.
5. At the bottom click on the padlock, type in your password and then change the Privilege column for your login name to "Read only". Close the Get Info window.
6. Launch Safari.

Btw, a great way to stop ad sites is to set up and use OpenDNS. Also, if you dislike seeing ads in Safari you can install and try either of these: GlimmerBlocker or Safari AdBlock.

An alternate method has been emailed to me which I have not tried so use it at your own risk:

I can confirm that the following list of terminal commands works fine:
cd ~/Library/Caches/com.apple.Safari/
rm -rf "Webpage Previews"
ln -s /dev/null "Webpage Previews"

The only issue is that there is an error logged in the console for each website visited.


I haven't tried this as my method seems to be working so far. I think this is from the discussion forums at Apple. Unfortunately I can't credit the original poster as I'm not sure who it is.

UPDATE: Quit Safari toss this into the Terminal to effectively turn off Webpage Previews:

defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

Then relaunch Safari.

To return to Safari generating Webpage Previews quit Safari then throw this into the Terminal:

defaults delete com.apple.Safari DebugSnapshotsUpdatePolicy

Saturday, May 30, 2009

Scrolling Playback in the Timeline

FCP doesn't really like to scroll the timeline while you playback footage. And while I wish there was an OPTION for it, I'm okay with it not scrolling at all. It really does save some CPU when you're doing HD muiltclip editing and other CPU intensive tasks as well as increase your bandwidth usage as FCP pulls thumbnails from the footage on the drives to display in the Timeline. We'd probably see a lot more dropped frames if the Timeline scrolled all the time. At least in FCS2 on Leopard.

However, if you have a Mighty Mouse you can scroll with it's trackball while you're playing footage in the Timeline but this will eat up some CPU cycles as well as use a little more bandwidth from your hard drives. But, if a client insists that they see where the playback bar is while you're editing and playing edits, keep your fingers near the Shift and PageDown keys. Shift + PageDown will advance the timeline one "screen" at a time during playback.

Sunday, May 24, 2009

VisualHub Can't Convert .flv Anymore?



A client has handed you (meaning you've used Command + Option + A in Safari to open the Activity Window and downloaded that really cool video from YouTube to email your friends) a .flv that they need in some other format for something or other. Opening it in VLC you see that it's h264/mp4a and VisualHub begets you an error like "Cannot allocate temp picture, check pix fmt"

What do you do? Well, you can try altering the Decoding parameter in VisualHub to be QuickTime or ffmpeg or whatever but your luck will vary. It may just work, or need Perian or may never work. flvs are fussy like that.

Even the power of QuickTime alone won't do it; you need 3x the transcoding power.

A) Install Perian
B) Install MPEG Streamclip.
C) Launch MPEG Streamclip and drag your fussy .flv into it.
D) Export it to H.264 (QuickTime) or the codec of your choice.

See, QuickTime + Perian will PLAY the .flv but when you export it it'll likely be MOS (Mit Out Sound). But, opening it with the power of Perian plus exporting it with the power of MPEG Streamclip will result in a transcoded file with audio.

Yup. You didn't even have to restart :) The only downside is that the resultant file will be 60-70% larger than the original .flv but monkey with the settings in MPEG Streamclip and you can bring that down significantly without very much of a loss in quality at all. The first thing to change is the Data Rate with a lower kbits/s. Also, unless you need really high quality audio, try lowering the audio to 22.050 kHz.

Great, thanks, Mr. Not Bruce, but how do I delete these two apps now?

From Perian's site:

How do I remove Perian?
Open the System Preferences. Select the Perian pane and 'Remove.' Now 'Show All' preference panes, control-click the Perian pane and 'Remove "Perian" Preference Pane.


As for MPEG Streamclip...just drag it to the trash.

Friday, May 22, 2009

Where was that Render Folder?



A friend called today and asked me something I've never thought about before regarding FCP.

"How do I find out where the last Render Folder was for this project?"

"Why?"

"Because I have 4 hard drives hooked up and I changed the scratch disk for another project and FCP is asking which one I want to use now because that one's gone."

"Did you search for the project's name on your Mac? It'll be named that. Sort by Kind and look for folders. One will be inside a folder named Render Folder."

"There's no other way?"

"I guess you could look inside the FCP save file and search for the words "Render Folder"."

"How do I do that?"

"Drag the save file to TextEdit, it's basically a text file, then hit Command F and type in "Render Folder" and then hit Command G to skip through all the results. Look for what hard drive it's on."

"Ah. K cool. Thanks."

"Sure."

Thursday, May 21, 2009

Ejecting Optical Media


If you try to burn an optical media disc and for some reason it fails (the Finder is notorious for this...stupid .DS_Store files...) and you then try to eject it and can't no matter how many times you hit the Eject key or try ejecting in Toast, try launching Disk Utility and highlighting the optical disc and hitting eject in the toolbar. Usually, the disc will pop right out.

(Btw, recently I had a DVD+r DL disc that failed to burn in the Finder but trying the next disc in the spindle worked fine with Toast. Grrr.)

Extracting Stuff from .SWF Files


As an editor you'll be provided with the media the client wants to incorporate into the project. However, sometimes the client is utterly clueless and will send you things that are sometimes less than useful. A friend of mine called me in a panic because the client emailed him some media to use in the current project in the handy dandy form of a .swf file.

I'm sure the client asked the media department of their megacongolmerate for the "files" or the "images" or "whatever we have on the website" to synergize into their vertical brand marketing deliverables objective action points or some garbage.

Looking around I found this neat free app called Flaex which extracts stuff from .swf files. It even has previews of images and sounds right within the app, beware though that if you click on a long sound file there's no way to stop it from playing, you just have to wait it out.

Wednesday, May 20, 2009

Disk is in Use and You Can't Eject It

Ever had a hard drive you can't eject because the Finder claims it's in use even though no project is open on it, no file is open, no anything is anything on the drive?

Usually the culprit is FCP which sometimes doesn't want to be left all alone and desperately clings to any last vestiges of its former usefulness. There's a Terminal command to find out what is using the drive (or at least what file is open on it) but it's the Terminal and that's not very Mac-Like.

So, recently a free application called WhatsOpen appeared and it's perfect for finding out what's going on. Give it a try and donate something if you like it and find it useful.

This is different from when the Finder just decides to leave a properly ejected drive's icon in the sidebar which does happen on occasion. Those you can just drag out of the sidebar and enjoy the poof of smoke.

If you really want to know the Terminal command it's:

lsof | grep /Volumes/Stubborn-Hard-Drive

Where Volumes/Stubborn-Hard-Drive is the path to the hard drive in question. To make it a little easier just type:

lsof | grep

into the Terminal, then drag in the stubborn hard drive from the Finder and hit return. You'll see what file is "in use" on the drive. lsof, btw means LiSt Open Files.

Shift+N and Missing Frames

I haven't had time to really test this and see if it's an occasional bug or an actual repeatable bug but, I had a Typewriter Text Element which needed to be extended a few seconds after it completed it's action. So, opening it up in the Viewer and hitting Shift+N (for still frame) I noticed that it removed the last one or two frames of it's typing action.



So, instead of it reading Day014 it would suddenly read Day01 when I hit the key combo. I'll investigate it further but it was repeatable that day and I didn't try restarting FCP to see if that cleared it up. The project isn't over yet so I'll have more time to test it later.

Shift Delete Bug

Here's an interesting occasional bug in FCP:

I had two clips and their associated audio tracks highlighted. Then I hit Shift+Delete to perform a ripple delete. But one unassociated audio track refused to budge. You can see the result in the two following images.

Before the Ripple Delete


After the Ripple Delete


A restart of FCP fixed it which goes to show that something as complex as FCP can get confused sometimes.

Always make sure you set your auto-saves to a different drive than your project drive (preferably one with Time Machine going) and don't be reluctant to save and restart FCP when things get strange.

(the stills were pulled from a video my assistant took with his little portable camera, it's interesting to see the convex curves in the stills even though the editing monitor is a flat LCD, due to the lens on his camera)

Friday, May 15, 2009

SmoothCam Not Working


If you try to apply SmoothCam to a clip and nothing happens, no analyzing, no messages, no errors, nothing...your clip is probably in a format that SmoothCam doesn't like to work with. This can be especially tricky with SD footage.

To solve this, open up your clip in QuickTime Player and export it as Apple Intermediate Codec (or something else depending on the initial codec your clip was encoded to) and Save. Then bring it into FCP and apply the SmoothCam filter.