Turning Internet feeds into TV feeds

I’ve cobbled together a way to turn an Internet data feed into a video crawl that can run on my local public access cable TV channel. Before explaining how, I need to explain why. Here’s the short answer: As much as I want everyone to use the Internet for all it’s worth, most people don’t yet.

A couple of years ago, I was campaigning in my community to open up the parent portal into PowerSchool, a student information system that was being used internally by teachers and administrators but wasn’t available to parents via the Internet. At one point I made a screencast that addressed the perceived risks, and showed the compelling benefits, of opening up the portal. The screencast was published on the Internet, available to the whole world, and the whole world includes Keene NH, so that ought to be a good way to bring my message to the community, right?

Wrong. Nobody watched it.

A while later, it hit me. There still aren’t many folks here who are inclined to receive a message like that from InfoWorld.com, or from YouTube, or from any other Internet destination I might use. But there are significant numbers who tune into the local public access station. Why not show the screencast there?

So I dubbed it onto a MiniDV tape, took it down to the station, and gave it to the executive producer.

Him: What’s this?

Me: A demo and discussion of the PowerSchool software. Will you run it?

Him: Sure.

And lo, a couple of weeks later, I heard from the assistant superintendant of schools. He thanked me for applying the external pressure that they’d been needing in order to break through an internal logjam, and he invited me into the beta program. Now, two years later, it’s fully deployed and making a big difference.

Meanwhile, I’ve been working on a community information project that’s all about feeds and syndication. But slow learner that I am, I continue to invite people to use Internet feeds and Internet syndication. And people continue to mostly decline the invitation.

For example, I’ve been working on calendar syndication. The syndication flows two ways. First, inward. The service pulls events from various local websites, and I’m working with the proprietors of those sites to clarify why and and to publish true calendar feeds.

Second, it syndicates outward. With a JavaScript call, you can include the day’s events in another website, like CitizenKeene or Cheshire TV.

But this is all still just Internet stuff. And as we’ve seen, the community doesn’t (yet) tune into the Internet for local information. It does tune into public access cable TV.

So why can’t Internet data feeds show up there?

Well, of course, they can. Here’s a prototype video crawl (the link goes to an animated gif, just for convenience) made from yesterday’s combined calendar. We’ll need to work out the details of format and workflow, but I think it’ll work. And it seems like a great way to connect two worlds.

Calendars are just part of the story. Consider, for example, the public library’s RSS feeds announcing new books and DVDs. I’m one of probably a handful of subscribers to those feeds. Now imagine that the feeds showed up as a video crawl on TV. I bet a lot more folks would find out about new books and DVDs. And maybe, just maybe, the reception of that feed via TV would lead to discovery and use of the more convenient and powerful Internet feed.

We’ll see. Meanwhile, below the fold, I describe the method I’ve come up with to do this. The paint isn’t dry, and I’ll be very interested in comments and suggestions.

… the fold …

Our public access TV station, as may be typical (though I dunno), is a mostly Windows-based operation. As is surely typical, there’s little money to spend, either on people to produce these feeds interactively or on software to produce them automatically. So the requirements seem to be:

  1. Windows-based
  2. Cheap or free
  3. Fully automatable

My first idea was to leverage SMIL. I knew it would be easy and free to transform a feed into markup that can be played by Real, or QuickTime, or Windows Media. And I hoped it would also be easy and free to render that markup into a video format. But there I ran aground. If there’s a free, or at least cheap, SMIL renderer that can be scheduled to run automatically, I’d like to know about it, because that’d probably be the ideal solution. But I haven’t found one.

The next idea was to produce the animation frame by frame. And that’s what I’m actually doing for now. It sounded a lot harder than it turned out to be. After installing the Python Imaging Library, it was possible to write this very concise frame generator:

import Image, ImageFont, ImageDraw

s = """
EVENTS FOR WEDS JUNE 30 FROM ELMCITY.INFO (HTTP://ELMCITY.INFO/EVENTS)

06:00 AM lap swim  (ymca) 
07:00 AM Cheshire Walkers: Indoor Walking Program (eventful: Keene Recreation Center) 
...
Trainers Academy - Level II (eventful: Monadnock Humane Society) 
TOR 7pm (swamp bats) 
"""

lines = s.split('\n')

def frame(index,top):
  image = Image.new('RGB',(720,480),(0,0,0))
  draw = ImageDraw.Draw(image)
  font = ImageFont.truetype("arial.ttf", 18)
  for line in lines:
    draw.text((10, top), line, (255,255,255), font=font)
    top += 25
  image.save('cal%0.3d.gif' % index)

top = 450
for index in range(len(lines)*8):
  print index,top
  frame(index,top)
  top -= 4

This yields a sequence like cal000.gif…calnnn.gif.

I wasn’t sure how to make a video directly from that sequence, but I knew that ImageMagick could turn it into an animated GIF, like so:

convert -adjoin cal???.gif animation.gif

So I did that, and went looking for ways to convert that into a video format. ffmpeg will do it, but the results weren’t pretty, and ffmpeg can be a dicey thing to ask people to install. QuickTime, I found, did a better job. You’d need QuickTime Pro for Windows, which isn’t free, but $30 won’t break the bank.

Now the question became: How to automate the QuickTime conversion? I installed the QuickTime SDK, went looking for examples, and found just what the doctor ordered. Thanks, Luc-Eric!

Luc-Eric’s JavaScript solution, which runs on the Windows command line courtesy of the Windows Script Host, turned out to provide a double benefit. In addition to showing how to automate the conversion of a batch of GIFs to an AVI, it showed me that there was, in fact, no need to produce an intermediate animated GIF. You can just point QuickTime at the sequence in the same way that you can point ImageMagick at the sequence. I hadn’t known that! So ImageMagick dropped out of the toolchain, and there was one less component to require the station to install.

So that’s where things stand. I’m pretty sure there’s a better way to meet the requirements, and I’ll be delighted to discover it. But maybe there isn’t, in which case it looks like this will work.

Either way, it’s the end result that will — or maybe won’t — matter. We’ll do the experiment, and we’ll find out.

Posted in .

24 thoughts on “Turning Internet feeds into TV feeds

  1. Have you considered Avisynth (www.avisynth.org) for scripting video that can be played in any DirectShow-based player?

  2. coolio, jon, great idea. “we” keep wanting people to *get it*, and understand what’s so great about the tools we use. but people much prefer to use the tools they already use. if you can’t beat em join em.

    wonderful work.

  3. I agree whole-heartedly with hugh. One media never truly destroys the previous one. The all tend to collect and accrete like sediment. Eventually stuff is forgotten and cast off (like semaphore flag signalling to communicate on battle fronts). But in our day and age, film didn’t kill the theater, radio didn’t kill film, T.V. didn’t kill film or radio, video tape didn’t kill T.V., and the Internet didn’t kill T.V. You just have to survey the landscape pick what’s still got a lot of eyeballs attached to it and re-use that.

    Not to be to Microsoft-centric but is PowerPoint an option? Most of the ‘message boards’ in public venues (bank lobbies, airport terminals) are nothing more than glorified TV sets attached to a PC with PowerPoint slides flipping by. Seems to me the Calendar feed in XML format would import right in as a slide show if it was formatted properly. If a PC had an s-video connector or a video composite RCA jack they could run that through their Master Control board and just turn to that video feed when it came up in the schedule.

  4. Apple’s Quartz Composer doesn’t run on Windows operating system but may provide a model for what you are looking for. One of the built-in screen savers and projects is an RSS visualizer. It comes with the $0 developer tools.

    Quartz Composer to DV Stream

  5. All of this and more is already happening at Denver Open Media (http://www.denveropenmedia.org/). Voting for shows via the web determines what airs each day. Viewer’s can SMS feedback to live show that appears in the scroll. Even better news… thanks to a generous grant from the Knight Foundation (http://www.newschallenge.org/tools_for_public_access_tv), we’re modifying these Drupal driven solutions into a system any public access channel can use. If you are interested in seeing this used at a public access channel in your area, offer them some of your time helping with the technical side of things and encourage them to apply for integration support from us when the application process starts next month.

  6. Hi Jon,
    We’re actually approaching the same idea from another direction – as a broadcast TV group.

    Using our broadcast graphics overlay system we create a list of commonly used RSS feeds, turn those into a playlist, and push it onto TV.

    We’re selling the ‘content-association’ aspect of external feeds(licensed), and ability for clients to broadcast their own feeds.
    Turn around time is thus down to a couple of minutes. Clients are liking that!

    So far only have 2 design templates: both are scroller overlays, but there are picture based templates and even a squeeze-screen option coming soon.

    Do contact me if we can be of assistance.

    rgds,
    Paul Moss
    GM, Platforms&Technology
    Media Prima
    paulmoss@8tv.com.my

  7. Jon, a quick suggestion: Instead of redrawing each frame from scratch, you could render the entire content to a really tall 720px wide image and then “save” progressive 480px high slices. That may let you generate more complex content and still permit smooth scrolling.

    And something like mplayer should let you turn the frames into a movie without the quicktime license fee.

  8. > is PowerPoint an option

    Yes, as it turns out. PowerPoint 2007, even. So now I get to do a nice case study in translating data into PowerPoint XML. The station has a box that can run that show in a loop, and be switched to at intervals during the day.

    All this tech stuff is, of course, just a sideshow. The real game remains educating the public about why and how to produce data feeds, and — as the aggregation of those feeds becomes more visible — respecting community standards by agreeing which feeds to trust. That’ll be really interesting!

    Anyway, an alliance with the local TV station will be hugely helpful in moving all that forward.

  9. We’re in the final stages of testing ScreenScape http://screenscape.net

    We’re making it simple for venues to operate their own screen display and easily share content.

    Our displays are Internet-based but in theory they could used as a source for TV.

  10. This is great stuff. Please consider writing a Scala EX module for this application. (Scala is a digital signage product that is widely adopted by access channels. EX stands for Extender Module.) The program could take care of all of the display characteristics which it does very well. There’s just no obvious way to use the app to pull RSS feeds.

  11. I have a digital sign setup at the university where I work that uses Quartz Composer-based screen savers to animate an RSS feed based on posts made by campus community members to a weblog. We use Mac minis and (relatively) inexpensive LCD screens. I’d be happy to share any and all of the files I’ve developed if it would be helpful.

  12. Pingback: lucrari de diploma

Leave a Reply