[mythtvnz] DNLA/UPnP server

Steve Hodge stevehodge at gmail.com
Wed Dec 9 09:15:12 GMT 2009


On Wed, Dec 9, 2009 at 9:08 PM, Stephen Worthington <
stephen_agent at jsw.gen.nz> wrote:

> Now that I know more about transport streams, I think you are right.
> In order to store the streams MythTV is receiving, all it needs to do
> is to create new header packets referencing just the streams it wants
> and then copy only the packets with the PIDs referenced in those new
> headers.  Plus a few other packets that provide time/sync referencing.
>

Actually it doesn't even have to do that. The "header packets" (PAT/PMT) are
already there and can be dumped out as they are found. Since mpeg2 ts is
designed for streaming those packets are replicated periodically through the
file, i.e. it doesn't matter what order they appear or anything like that
and the only references/pointers are PIDs so nothing needs fixing when you
strip unrelated streams out. The time sync stuff is in the PES streams
themselves. All MythTV does is find the PMT so it knows which PIDs are
related to the program (in mpeg-spec-speak, i.e. channel), and then just
tell the driver to filter the stream for those PIDs. MPEG2 TS Packet
Analyser on the file I mentioned before to get the list of PIDs in the file
gives:
PID - count - description
0 - 32629 - PAT
274 - 34958 - PMT
520 - 8645718 - video
658 - 446727 - audio
1001 - 567669 - I'm pretty sure this is MHEG (I know there is MHEG data in
the file and this is the only unaccounted for stream!)

The basic difference in the AVCHD format is only the 192 byte packets
> with extra time reference information in the 4 extra bytes.  All the
> rest of the AVCHD format for transport streams seems to be just
> restrictions on what you can put in them, such as only AC3 or PCM
> audio.




More information about the mythtvnz mailing list