Friday, September 18, 2015

Marco Did The Right Thing

Marco Arment released an iOS 9 Content Blocker on Wednesday and it quickly rocketed up to #1 on the Paid App Store charts. At that ranking, apps can pull in tens of thousands of dollars per day.

For very good reasons, he removed it from sale this morning. And then things got nasty.

Thing is, I think I understand what this week has been like for Marco. In a lot of ways, it reminds me of what happened when a site I wrote went viral a few years ago.

If you’ve never made something that’s gone viral before, let me break down how it feels like for the maker:

  1. You’re in shock. You can’t believe something you made resonated with so many people.
  2. You freak out because your inbox has become a disaster.
  3. You try to get some work done and deal with the explosion of feature requests and attention.
  4. You start reading online and notice people are saying some really shitty things about you.
  5. At this point you can’t think about anything else except the shit that people are giving you.
  6. You want to shut it all down and forget about it.

For anyone who thinks Marco thought this through or planned it in advance, you’re just deluding yourself. Who in the world could anticipate making a #1 rated app in the App Store. I don’t think any independent developer has ever done this outside the context of a game.

If I were Marco, I’d have been feeling dejected and depressed by this morning and would’ve wanted all of the attention to go away. No one person can deal with it alone.

In his post, Marco specifically pointed readers to instructions on how to get App Store refunds. I mean, people, if he was actually trying to scam you, don’t you think he’d just leave the app up on the store and just never say anything else about it? At least he’s being honest. If you already purchased the app, it’s not like you didn’t get anything in return.

You bought a working app. It still works. It will continue to work. There is no scam. Marco isn’t being an asshole. If he’s anything like me, he’s overwhelmed and just wants to get back to normal life. Being the center of crosshairs can really suck.

Be a little more empathetic. Thank Marco for being honest. Respect his decision. He’s just a person like you and me. I realize how easy is can be to forget that when everyone is just an avatar, but please take it to heart. I wish more people did when a similar thing happened to me 4 years ago.

Sunday, July 26, 2015

Making a time-lapse on the command line using FFmpeg and ImageMagick

We’re vacationing in Whistler, BC right now as “endurance spectators” to my father-in-law’s 3rd Ironman triathlon. Expecting some beautiful landscapes and weather, I brought my newly acquired X100T to take some nice photos.

Yesterday, I set it up on an interval timer and pointed it right towards Rainbow Mountain, which faces the patio in the kitchen of the little condo unit we’re renting out. After all was said and done, I ended up with 400 images depicting clouds moving over a mountain peak and not much idea of what to do with them. So, as any self-respecting engineer would, I set out to create a time-lapse using only my trusty command-line tools: FFmpeg and ImageMagick.

Let’s get down to it.

Note: Everything in this tutorial assumes that you have a current copy of ImageMagick and FFmpeg installed on your machine.


Even though I turned off RAW on the X100T, the images were still pretty huge (4896x3264). During my first tests, making movies from images this large gave really inconsistent results and took a long time to create, with not much extra benefit.

Therefore, the first thing you should probably do is check the size of your images and, if necessary, resize them to be a bit smaller so they will play more nicely with FFmpeg and any other image manipulation that you’re going to do.

Since I planned to upload my video to YouTube, I referenced a handy page they have that lists out their preferred resolutions, codecs, and formats for upload ( If you’re like me, and you don’t care too much about maintaining the current aspect ratio, here’s what you can do. This will resize your images to a preferred resolution (in this case, 1280x720), and will potentially crop off the sides or top in the process. To start, make sure you’re in the directory with all of your photos.

$ for FILE in `ls *.JPG`; do \
  mogrify -resize 1280x720^ -gravity center -crop 1280x720+0+0 +repage -write RESIZED_PHOTO_DIRECTORY/$FILE $FILE; \

In detail, this command -resizes photos to a 1280x720^ resolution (the caret means that the smaller of width and height is maintained and the larger one is kept even if the resolution is larger), and then, by using -gravity and centering, we crop the image to 1280x720 exactly, and write to RESIZED_PHOTO_DIRECTORY/$FILE. Phew, that was a mouthful.

If you just want to resize to a certain height/width and want to maintain the original resolution, just do this:

$ for FILE in `ls *.JPG`; do \
    mogrify -resize 600x -write RESIZED_PHOTO_DIRECTORY/$FILE $FILE; \

Maintaining Color Distribution

Note: this step might not be necessary in your situation, but it greatly improved the quality of the final product for me. YMMV.

Sometimes images captured in a time lapse have very different histograms (especially if you have auto-aperture / shutter-speed enabled), and this can make things look “jumpy” from frame to frame. Obviously, this won’t look great in your final video, so we’re going to normalize the colors to a set distribution.

For an example, just compare the following two images (especially notice the trees, which are much lighter in the first example than the second):

Not ideal, right?

To help achieve this end, I used an ImageMagick script called histmatch, generously provided by Fred Weinhaus (link: The idea to use a reference image to generate a histogram that we want all of the other images to match. Once you’ve decided on your reference image, run the following on every image except the reference image (otherwise the universe will explode).


(I just piped the output of ls *.JPG into a file called and used some of my Vim-fu to do this. Your process might be different.)

Finally, make the darned movie

This is the fun part. Just send the files through to FFmpeg and have it do its magic. If filenames are incrementally named, you’ll want to provide the parameters below (like -start_number and the _DSF%04d.JPG format) to make things match up.

$ ffmpeg -start_number 1 -i _DSF%04d.JPG -c:v libx264 -pix_fmt yuv420p video.mp4

This tells FFmpeg to take all of the JPEGs in the directory starting with _DSF and ending with 4 digits, and to output an h.264 video with the yuv420p colorspace to video.mp4. You now have a beautiful timelapse!

If you’re interested in the final product, you can check it out on YouTube. Enjoy!

Monday, June 8, 2015

Post-WWDC 2015 Keynote Thoughts

It’s now been a few hours after The WWDC 2015 Keynote, and I’ve had some time to digest everything. My immediate impression of everything was a little “meh”, but then again, that’s sort of how I feel every year. It’s hard to satisfy everyone.

Second impression is that the WWDC Keynote is no longer for developers. It’s for the end users and wannabe developers. Us old-timers are too jaded to care about this new and shiny stuff, and most of the new products in the keynote aren’t even things developers can use (on that note, was it really necessary to spend that much time on Apple Music?).

Another noteworthy thing–no new hardware. I was expecting at least something, so to hear crickets was a little unfortunate. I can only assume that the inordinate amount of time spent talking about Apple Music was in some part due to a need to “fill time” from what would have originally been a 15-20 minute spiel on Apple TV.

As always, the things that are exciting to me happen in the sessions throughout the week. The Keynote is sort of just a preview of what’s to come. After some perusing through the documentation, here’s what I’m excited about:

Deep Linking

I wrote about this in my WWDC 2015 Wishlist, and it came true. You can now link up URLs to be opened by your application. I haven’t had too much time to play around with iOS 9 yet, so I’m not sure how this works from either the developer or end-user side of things, but my first impression is that Apple did this right.

Besides the notable backtracking of moving search away from the pull-down gesture and back to the left of the home screen (I would have loved to be a fly on the wall in that meeting), iOS Search can now display search results straight from apps in Spotlight.

Just to illustrate an example—my company writes an app called Tweet Seeker that lets people download their Twitter archives and search their tweets locally on their device. Tweet Seeker can now hook right into iOS and display tweet search results right from Spotlight. Now that’s cool!

iPad Multitasking

Remember the iPad Pro? Well, this is it. You take a regular iPad, and you install iOS 9. There. iPad Pro. :claps:

You know those things that you can’t really imagine a use for, or want, and then in 3 months you realize you can’t live without it? Yeah, well, I’d put money that this is one of those things.

I can see this changing how people use their iPads, along with the new keyboard gestures. The iPad is no longer just a toy, or larger screen iPhone made for watching Netflix and HBO. It’s now a tool to get shit done.

Swift 2

I think it’s great news that Swift is going open source “later this year”. Of course, in Apple parlance, that means probably somewhere around December 15-31 (just trying to be realistic here–it’s not easy to open-source something like this, I’d bet there is a ton of proprietary code lurking in that codebase).

Also, I think with this release, I’m comfortable picking up the Swift book and starting to actually learn the language. I am embarrassed (only a bit, though) that I haven’t written a single line of code in the language. With this latest release, I think I might be ready to start jumping in. A 2.0 implies a little more stability, and other developers who were waiting on the sidelines will probably jump in on the fun as well.

Another telling thing is that all the code I saw in the “Developers State of the Union” Keynote was written in Swift. I don’t think it’s any secret now that Apple considers Swift to be the future. As much as we might not want it, it’s going to happen.

If you started learning it a few months ago, though, prepare to have to relearn a bunch of stuff. I wouldn’t be surprised if Apple pulled the rug out from under you.

Apple Music

I’ll keep it brief. I don’t need it. Spotify works great for me. I think its success hinges on musicians buying in. We don’t want another Ping here.


You’ll notice I skipped over a lot of the OS X stuff. I honestly haven’t had enough time to digest it all. So. Much. New. Stuff. Will download and report back.

That’s it for now. I’m taking a walk to think about this all some more.

Wednesday, June 3, 2015

WWDC 2015 Wishlist

Here’s my list of things I’d be overjoyed to see fixed / announced / released at WWDC 2015 next week.


  • Deep linking support. Let apps define associated URLs (* –> open
  • Really want to hide my carrier and clean up that status bar. Such a mess right now.
  • It’s time to modernize the UI for and iOS 6 was years ago.
  • Save alarm and world clock data in iCloud. Re-adding this on every device is really tedious.
  • Export data or save it in iCloud with a password. At the moment, it’s not shared between devices and will be lost permanently if you don’t have an encrypted local iTunes backup of your device.
  • Needs to be a way to close all tabs in Safari without tapping the screen 50x times. Absurd.

  • Search that actually works. Right now this is the only reason I still have the Gmail app still on my phone. I open it up whenever I want to search for a message.
  • Send from an alias like Gmail web client lets you.
  • Better UX for labeling threads.


  • (I’ve mentioned this on Twitter) Fix the UX with reviews of physical locations.
  • Public transit support.
  • Improved traffic data.

App Store

  • Search. Need I say more?
  • Direct refunds without iTunes support involvement.
  • Responding to reviews would be nice.
  • Expire old reviews (1yr+) when new versions of app have since been released.

Safari (OS X)

  • Reopen more than the most recent closed tab in Safari.
  • Paste images into web pages.


  • Stop beachballing so darn much.
  • It would be nice to stop an archive action without needing to restart the app.
  • Debugging extensions is currently a huge pain. It would be nice if it were easier.

Added 6/7/2015

Photos on OS X

  • “Show in Finder”

View the rest of the archives