Clear DNS cache on OS X 10.8 Mountain Lion

Historically, the Directory Services were responsible for DNS queries and caching on Mac OS X 10.5 and earlier. Back then, to clear the DNS cache one would issue the “dscacheutil -flushcache” command. With the further development of various services based on the multicast DNS a mDNS service fully took over both unicast and multicast DNS queries and response caching on later OS X versions.

While the “dscacheutil” is still there even on OS X 10.8 Mountain Lion, it won’t reset the caches properly. The correct method to clear DNS cache on 10.7 and 10.8 is to restart the mDNS service, “mDNSResponder”:

sudo killall -HUP mDNSResponder

If this doesn’t seem to help, try reloading the service:

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Moving Apple Mail settings from computer to computer on OS X 10.8 Mountain Lion

The location has changed since Mountain Lion is out, now the Apple Mail settings reside in:

~/Library/Containers/com.apple.mail/Data/Library/Preferences/com.apple.Mail.plist

The Mail messages, rules and Notes are still in the old location:

~/Library/Mail

Just copy the contents to your new computer, and you are done!

FFMPEG settings for maximum quality h.264 video on AppleTV Gen 3

AppleTV Gen 3I believe I’m not the only person who has bought AppleTV Gen 3 and been pondering about the best way to convert the existing media collection to a format acceptable by the AppleTV. After some research & experimentation, here are my findings:

Video: AppleTV Gen 3 claims to support H.264 video bitrates of up to 25Mbits. My findings: While it has no problem playing back videos with bitrates up to 40Mbits (even encoded with the ffmpeg’s highest quality setting  of -crf 1), the buffering of the iTunes Home Sharing stream wasn’t adequate and the buffer was being exhausted every minute or so of the playback making it unwatchable.

Audio: AppleTV Gen 3 claims to support AAC stereo bitrates of up to 160Kbits. Suspiciously low, isn’t it? My findings: AAC 5.1 (6 channels) audio plays back ok on my TV at 640Kbits. AppleTV is just passing through the unencoded audio to the TV via HDMI, and TV is down-converting the audio to 2-channel stereo mode.

Continue reading