Monday, October 29, 2012

Q: What is it like to have the process of video encoding or transcoding bring you to tears?

In 2005, we built a system to do the first amateur ATSC HDTV broadcasts. We broadcast MIT sporting events and the January "Integration Bee" (with play-by-play and color commentary, etc.) on the MIT cable TV system. (http://broadcastengineering.com/newsrooms/mit-sportcast-plan-calls-hd-telecastshttp://sportcast.mit.edu)

The plan called for us to build our own live HD switcher with wipes and other transitions, score overlay and ATSC encoder -- a commercial system was several hundred thousand dollars at that point. We had four HDV cameras connected via Firewire to a head-end computer, and used an array of 1U servers with nVidia cards to render an arbitrary scene with OpenGL (using a pipeline through four machines to paint the video from four cameras on the frame), then overlay the score and time, and finally encode with A/52 audio in ATSC-conformant MPEG transport stream and send out in QAM256 over the MIT cable system (http://web.mit.edu/sportcast/checkout/).

Some of the technical challenges proved especially difficult and I was up all night with them before a game. Getting four Firewire HDV cameras to talk to the same computer was a real pain, since these cameras generally have cheap chipsets and all want to talk on the same broadcast channel. (We got this working, but it was quite brittle since unplugging one camera would freeze the whole Firewire bus for about 1 second. In year 2 we switched to connecting the cameras to small Mini-ITX computers and then running them to the switcher over UDP on Ethernet.) Showing up at 10 a.m. at a volleyball game and having to explain to my colleagues that we STILL didn't quite have working video was painful!

The most challenging part was writing the MPEG systems stream encoder that would be ATSC-complaint -- in other words, writing a program to stitch together Dolby AC-3 audio and MPEG-2 video that would actually PLAY in sync on a real store-bought television without glitches. (The MPEG-2 video elementary stream was compressed by libavcodec, and the audio by liba52, but getting a compliant audio-video multiplex is a different story.)

This was difficult because those TVs do not exactly give you a lot of helpful diagnostic information. If you do it wrong, you see glitches, but these can be very rare (like once every 20 minutes!) and it's not like you get a debugging trace. 

ATSC has a lot of requirements you have to comply with, like you can't send a frame of video more than 0.5 seconds before it will be displayed, and if you break these you will see undefined behavior from the TV.

Getting all those pieces put together, so we could actually WATCH our sports broadcasts on a real HDTV in 2005 via the cable TV system without hiccups, was very satisfying and a great payoff for all our work. After spending umpteen all-nighters doing it and breaking numerous promises to my friends and colleagues to have it running earlier, I am sure I was brought to tears (of exhaustion and/or joy) when it finally worked.

4 comments:

  1. Thanks for sharing, nice post!

    Đến với Bruno.vn - shop thoi trang tphcm các bạn tha hồ lựa chọn cho mình những những kiểu áo sơ mi nam đẹp nhất hay bạn thắc mắc quần short nam rẻ hay thắc mắc mua quần jean thì đến với chúng tôi. Ngoài ra, tại đây có bán những thương hiệu thời trang nổi tiếng thế giới với những ao thun nam dep hcm tha hồ lựa chọn, hay với những mẫu áo khoác nam đẹp uy tín, giá rẻ với quan jean nam dep nhat hien nay đẹp, đa dạng mẫu mã hay mẫu quần kaki nam thì đến với Bruno - shop quần jean nam đẹp tại tphcm hay địa chỉ quần áo nam hàng hiệu chính hãng cực uy tín. Đến với Bruno.vn là địa chỉ shop áo sơ mi nam đẹp tphcm bạn có thể chọn áo thun với shop áo thun nam đẹp tphcm thời trang hàng hiệu hay shop áo khoác nam đẹp tphcm cực cá tính với nhiều áo khoác da nam đẹp hay hướng dẫn bạn phân biệt quần jean levi’s 501 thật giả cực hay hay bạn có thể chọn quần áo h&m cho mình hay bạn có thể chọn mua quà gì tặng sinh nhật chồng tại Bruno, hay bạn muốn nên tặng quà gì cho bạn trai thì đến với chúng tôi. Bạn băn khoăn mua áo sơ mi nam ở đâu đẹp tại tphcm thì đến Bruno.

    ReplyDelete
  2. in this site WP SMS Marketing are most any helpful to make so that sure your SMS marketing campaigns grow in this sit e,,,,,visit sit e

    ReplyDelete
  3. I found your entry interesting do I've added a Trackback to it on my weblog .

    ReplyDelete

Note: Only a member of this blog may post a comment.