I have too many unfinished projects. I think of a project and I can think of nothing else. It rattles inside my head, making it difficult to think of anything else. But as I actually start the project the noise quiets down and life returns to normal. But then I get another idea and I can never quite get back to finishing off the project.
Currently rattling around in my head is an idea for an MPEG Transport Stream separator. This relates back to my idea of using my PS3 as a MythTV front end. (That project is stalled for a few reasons, including my unfinished outdoor antenna project.) I have some sample ATSC captures which the PS3 won't play back without "transcoding", which I'd like to avoid. The files are basically raw MPEG Transport Streams, and I suspect the reason my PS3 won't play them is because they 1 - are slightly corrupted and don't begin nicely and 2 - contain multiple channels.
However, the transport stream is a fairly simple container format. The audio & video streams are chopped up into 184 byte chunks, then a 4 byte header is added. (Except for the start & end of frames which have a timestamp or padding added respectively.) The whole mess is then multiplexed together with some metadata packets. So unlike other container formats, my program only has to deal with packets and parsing some of the metadata. Everything else can be passed through unchanged.
The audio and video streams for each channel in the transport stream are identified by the Program Map Table and the PMTs are identified by the Program Access Table. So, to extract a single channel I need to find and parse the PAT and the PMT then copy over all of the packets for just those audio and video streams along with the PMT and a PAT which only contains that channel.
Surprisingly, I haven't found a tool which does this. However, there are other tools which do various repairs on transport streams. So I don't know if I need to implement something like that.