[mythtv-users] Why do those mpeg files not play? (capture with a ceton infiniTV 4)

Daniel Kristjansson danielk at cuymedia.net
Sat Jul 9 16:05:34 UTC 2011


On Sat, 2011-07-02 at 17:15 -0400, Ronald Frazier wrote:
> For anyone that know a bit about mpeg files, can you please take a
> look at the sample files I'm linking below and tell me why they seem
> to not work for me in certain media players?
>
> cat /dev/ceton/ctn91xx_mpeg0_0 > file.mpg

The problem is that the files contain the original tuning tables but
only one of the program streams contained in the original stream is
present in the data you get from the device. When you use a CableCard
the tuner it must send all but one of the program streams to /dev/null,
but it does and should send the full tables through unmolested. It's
up to the recorder to trim those down so that they only describe the
recorded program.

In particular you must rewrite the PAT table so that it only points
to the active PMT table. Otherwise the media player won't know which
program is active, except via error prone probing. You should also
trim out any extra PMT tables and start the video file after the
first key frame, but you will get reliable video by just doing the
PAT.

MythTV has a class for doing this for you called MPEGStreamData
you just need to set the desired program either in the constructor
or vie SetDesiredProgram() and it will give you the single program
PAT and PMT tables via the HandlePATSingleProgram() and 
HandlePMTSingleProgram() callbacks and send the AV data out via
the ProcessVideoTSPacket() and ProcessAudioTSPacket() callbacks.
If you inherit from DTVRecorder this is all handled for you so
all you need to do is initialize the MPEGStreamData with the program
number and then read data from the device and send that data to
your MPEGStreamData instance and the DTVRecorder will take care
of writing out a well formed recording as well as generating the
keyframe map in the database (used for faster and more accurate
seeking).

- Daniel



More information about the mythtv-users mailing list