Tuesday, December 07, 2010

NYTimes App in Chrome Web Store

The New York Times Chrome App looks kind of familiar :-). From playing with it a bit, it looks quite beautifully done. It also looks like they have some the same troubles I did with counting pages accurately and keeping the columns properly aligned with the pages. As far as my Greasemonkey script goes, I've had very little time to update it recently. If / when I do get any time, I'd like to do a significant rewrite, basing the article text extraction on Readability and maybe just doing the whole thing as a bookmarklet. Perhaps a good project for the holidays...

Sunday, October 17, 2010

Camcorders and Interlaced vs. Progressive Video

My Canon FS100 camcorder records video in the funky MOD file format, making the video files rather difficult to work with using standard software. I recently spent some time trying to figure out a better way to deal with these files and learned a few things about video formats that I thought I'd write down to possibly save someone else time.

Why are the FS100's MOD files hard to work with?

MOD files from the FS100 basically have MPEG-2 video with AC3 audio, which works great for burning to a DVD. However, I mostly want to share the videos on sites like YouTube, for which purpose the MOD files are problematic in two ways: (1) the aspect ratio of the video is not marked properly within the file (fairly easy to fix), and (2) the videos are interlaced (a bigger problem).

What is interlaced video?

Wikipedia explains things pretty well. Basically, in interlaced video, only half the horizontal lines are recorded / drawn in each frame (odd lines in one frame, even lines in the next). This technique saves significant bandwidth compared to progressive scan video (which records every line in each frame) without much (any?) quality loss on older CRT TVs. But, interlaced video looks terrible on LCD TVs and computer monitors (which are progressive displays) due to combing artifacts.

How does one convert the FS100's interlaced videos to progressive?

Apparently, deinterlacing a video is a really hard problem. The best free solution I've found is HandBrake; see their deinterlacing guide. In the process of deinterlacing, I also re-encode the video as MPEG-4. It would be nice to avoid this re-encoding, but the need to deinterlace makes it pretty much necessary (VLC can deinterlace video during playback, but you have to enable it manually, and most players don't have this feature).

What to DVDs and DVD players do about this interlaced vs. progressive issue?

DVDs almost always hold interlaced video. For video from a television source, no conversion is needed. For film sources, conversion to interlaced video is usually accomplished as part of 2-3 pulldown (aka 3:2 pulldown), which also serves to fix the frame rate mismatch between film (24 progressive fps) and NTSC video (60 interlaced fps). David Bordwell wrote a fascinating post on this topic a while back.

A progressive scan DVD player outputs a progressive signal on those outputs that support it (e.g., HDMI). For film sources, the original progressive frames should be recoverable if the proper MPEG-2 flags were used on the DVD, though 2-3 pulldown is still necessary if the display is 60Hz. For television sources, algorithmic de-interlacing must be performed.

Note that for displays with a refresh rate that is a multiple of 24 (e.g., 120Hz), it's possible to "undo" the 2-3 pulldown (known as reverse telecine) and simply repeat each frame a constant number of times to match the display's refresh rate, removing some artifacts.

120Hz / 240Hz LCDs are supposed to reduce motion artifacts for sports, etc. How does this work when the input signal is 60fps, e.g., a TV broadcast?

Since there aren't any additional frames in the input signal to display, these TVs typically reduce artifacts by interpolating new frames or by darkening the display between frames.

Monday, September 13, 2010

Thoughts on Droid Incredible

So I finally joined the smartphone world. I went with the Droid Incredible—I didn't want an iPhone (wanted to stay with Verizon and didn't like the programming restrictions, though they have now been relaxed to some degree), didn't like the size of the Droid X, and didn't want the additional bulk of the physical keyboard on the Droid 2. Overall, I'm pretty happy with having a smartphone, Android, and the Incredible in particular. Other disorganized thoughts:

  • One big annoyance is that the Bluetooth functionality is rather broken on the Incredible and it won't pair in our car; see here. Apparently it's a software problem which you can get around by rooting and installing a different MOD. I'm still hoping an update will fix the problem.

  • (9/29/2010) I had a strange problem with voice quality a couple days after I first got my phone; others said my voice was very distant during calls. After searching all over the web for a solution, I went to a Verizon store and they couldn't find the problem either. Finally, I stared at the mic and noticed a speck of dust seemed to be blocking it. The Verizon guy blew it out with some compressed air, and them problem was solved. I'm really glad I didn't return the phone at that point.

  • Having the phone is great for running outside. I get some music going and then start up SportyPal, which tracks my route on a GPS and shouts times in my ear every so often. Later, I go online to check my pacing to see how I could run slightly less slowly next time. Update (10/7/2010): I forgot to mention that this armband fits the Incredible pretty well, though not perfectly (adjusting volume is a pain).

  • I set up Subsonic on a machine at home with our music and use the Android app to listen on my phone. It's not quite as good as having all my music on the phone (you need to remember to grab what you want ahead of time if you're not going to have a data connection, e.g., on an airplane), but it works quite well. I'm still looking for a good solution for managing podcasts. Update (10/5/2010): I bit the bullet and bought doggcatcher for podcasts. I was impressed that the developer worked around a bug with the 2.2 ROM on the Incredible that thoroughly broke seeking; this bug made using other apps like Google Listen very painful.

  • Astrid Tasks synced to Producteev is working well for managing TODOs, grocery lists, etc.

  • The camera is great to have in a pinch, but it's missing some basic features like image stabilization (many photos without flash end up being blurry) and adjusting zoom while shooting video.

  • Google Navigation generally works great, including the new walking navigation. But, in some cases it would be problematic to rely on it, since it needs a data connection to compute an initial route or (I think) to re-route if you miss a turn. If you're heading out into nature a lot, it's not a replacement for an app that downloads maps and computes routes locally or a standalone GPS.

  • In general, the app version of popular sites like Facebook, Twitter, and NYTimes are obviously better than the mobile web versions, which is kind of disappointing given the hype around the web platform. I'm not sure if this is because the web platform still needs work or because the sites aren't fully optimized for Webkit-based browsers (it's probably some of both). The Gmail and Google Reader mobile sites are pretty competitive with comparable apps, though.

  • Catch (formerly Snaptic) seems decent for jotting down and syncing notes. I tried Evernote first, but the Android app is just broken; you can't even read your notes without a data connection.

  • I wish I could try Swype.

  • Should I join Foursquare?


Anyway, it's the best new toy I've gotten in a while. Hopefully I'll be able to make some time to hack up a couple apps of my own eventually.

Thursday, April 08, 2010

Programming Languages on the iPhone

So I read about how Apple banned many programming languages from use for iPhone apps today, and I had a reaction similar to Rob's. John Gruber thinks that Apple did this to prevent frameworks from targetting both the iPhone and other platforms like Android, but he also argues that applications built using such frameworks usually suck. This seems like a contradiction to me: if apps built these frameworks suck so much, why take the trouble to ban the frameworks? To me, the ban seems like an admission that many apps could in fact be "good enough" when built on such a framework. Apple simply wants to make life harder for developers of such apps who want to target multiple phones, in the hopes that they will decide to just focus on the iPhone. What a lame move.