Tuesday, February 1, 2011

ASFRecorder part 2: fixing up streaming output

The project is coming along quite well, and I mean quite well, and I'm at a stage where I'm almost ready to build a plugin framework to host a beta. Here's a quick run through what I've had to do so far to get the output to a point where more than just VLC will play

  • Remove all references to the extra streams that are filtered out, including removing a few headers, rebuilding the header section in the process
  • Add padding lengths  to each data packet (because packet sizes are fixed, the server actually breaks its own standard by not setting the padding lengths, so although this is a trivial exercise, it was more work than I wanted to do)
  • Add packet length values to a sparse minority of data packets (something like one in 100,000, but it breaks avidemux) by manually summing the payload lengths, and then setting the padding lengths accordingly
  • Remove the null data packets (once again, these are fixed length, so easy to detect and skip, but this not only breaks the standard, I strip about 10% off the size of the file once these are removed)
Was it worth it? Turns out trying to appease avidemux wasn't the best goal, as its wmv reader module looks quite seriously broken (maybe it doesn't read the keyframes but the output has tons of artifacts), but now the output works on that, vlc, windows media player, and totem movie player.

It should all be smooth sailing from here though - just putting the post processing routines into a single module, getting ASFRecorder up to scratch, possibly tying the two modules together (or maybe that can be the second release), then doing all the GPL documentation and putting the demo plugin together.

I just hope I've gotten the hard part out of the way now ;)

No comments:

Post a Comment