[mythtv] possible libavformat incompatibility with certain MPEG TS files

Rob Jones robj at fastmail.fm
Fri May 26 14:30:45 UTC 2006

On Fri, 26 May 2006 09:58:56 -0400, "Daniel Kristjansson"
<danielk at cuymedia.net> said:
> On Fri, 2006-05-26 at 09:55 +0100, Rob Jones wrote:
> > Hi,
> > 
> > I've been attempting to setup a dbox2 with mythtv (0.19 fixes branch).
> > Streaming of transport streams from the dbox  works ok, but libavformat
> > has issues reading the tables and assigning the PIDs when attempting to
> > play back the stream in myth. It doesn't *seem* to be a problem with
> > anything non-standard in the file, as dvbsnoop, tsreader analyzers have
> > no problems showing its contents, with a PMT and video/audio PIDs, and
> > mplayer etc. have no problems playing it back.
> This is probably because the (lack of) PMT handling in the
> dbox2recorder. If you want to fix it, look at something like
> DVBRecorder or HDHRRecorder. DVBRecorder listens to the
> HandlePAT/HandlePMT signals from the stream data class and
> creates the output tables itself, the HDHRRecorder listens
> to HandleSingleProgramPAT/HandleSingleProgramPMT which gives
> it generically cleaned up tables from the stream data class.
> Either approach will probably fix your problem.
> mplayer doesn't track PMT changes in the stream, so it won't
> pick up new streams such as dvb subtitles, audio, or new video
> streams, and it will get stuck when a stream goes away. But
> since it just ignores the PMT's after the first one, this also
> means it won't get thrown off by PMT trashing like this.
> If you're fixing this it would be nice if you also implemented
> a DBOX2SignalMonitor class. Tracking the PAT/PMT tables for
> the DBOX2 in the signal monitor would mean MythTV wouldn't get
> thrown of when the available DBOX2 channels change, or the DBOX2
> hardware is turned off.

Just as a first obversation, yes this does seem to be an issue with
dbox2recorder. It attempts to create a PAT and add it to the TS, but it
would appear to be invalid in some way. I haven't had chance to check
yet exactly what is erroneous about what it is adding, but simply
preventing PAT packets being injected allows the file to be played, I
assume through "best guessing" of which the video/audio streams are?

I'm away for the next week but I'll try and look at fixing this up when
I get back.

On an additional quick note, while I'm on this, the dbox remote control
can be locked out/unlocked (ie. when streaming of a channel is taking
place) with a http request to:

or unlocking on /control/rc?unlock

so I'll try and implement this when a stream starts to be received. 

There's another setting which sets the display to be in "record mode",
(/control/setmode?record=start / stop) but I'm not 100% sure if this has
any other effect than changing the OSD for the dbox.

Similarly, there is a setting for SPTS/PES mode
(/control/system?setAViAExtPlayBack=spts or
/control/system?setAViAExtPlayBack=pes) which would clear up the
necessity to manually set this on the box, but i would need to test this


More information about the mythtv-dev mailing list