[mythtv] [patch] PMT tracking in ffmpeg

Daniel Thor Kristjansson danielk at mrl.nyu.edu
Wed Oct 20 18:01:57 UTC 2004


The ffmpeg library only looks at the PAT and PMT tables when it 
initially opens an MPEG Transport Stream. This is a currently a 
problem in LiveTV mode, but we work around it by rewriting the PID 
values to always be consistent. But this hack doesn't work if the 
number of audio streams change, or if we simply want to avoid the 
rewriting hack.

This patch fixes this with respect to PMT tables, which are the ones 
causing us problems. I basically keep listening for PMT tables and 
whenever I see one I delete any unneeded streams and open any streams 
that we need in the with the new PMT. There is also a callback which 
lets our avformatdecoder cope with the changes.

This was a part of the hdtv-recorder patch, which I'm now starting to 
break up into smaller pieces. If you want to stress this patch, there 
is a define in hdtv-recorder.patch's hdtv-recorder.cpp called 
WHACK_A_BUG. When set it will change pid of the video and update the PMT
every few seconds.

The PMT patch is attached, and both patches are available at:
    http://www.mrl.nyu.edu/~danielk/mythtv/

BTW I've added STT parsing to the list of supported tables in the 
hdtv-recorder patch, and I've also shortened the informative messages 
when printing out most tables. I'm also converting ATSC time in tables 
to a QDateTime with the GPS time, and record the GPS to UTC time offset 
from the STT table in the ATSCStreamData class. The STT of one station 
has a GPS offset that's off by 30 years, and anothers GPS time is off 
from true GPS time by over 20 seconds... On a more serious note, I'm 
stuck when it comes to subtitle parsing. It isn't covered in the ATSC 
standards but in a seperate standard EIA-708. I can't seem to find a usable 
description of it anywhere. If anyone knows where I can find get 
documentation how subtitles are encoded (for free of course) please send 
me a pointer.

-- Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpeg-dynamic-pmt-v1.tbz
Type: application/octet-stream
Size: 7387 bytes
Desc: 
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041020/cf74f925/mpeg-dynamic-pmt-v1.obj


More information about the mythtv-dev mailing list