[mythtv] Re: Adding DVB-T support to MythTV

Richard King rak at cs.man.ac.uk
Wed Mar 19 02:28:05 EST 2003


On Wed, 19 Mar 2003 jng_junk at greenmail.demon.co.uk wrote:

> Hi there.
> 
> > Yep, I think MJPeg tools would definitely do the conversion to various 
> > different video formats, while ts2ps would demultiplex the initial 
> > transport stream.
> 
> Demultiplexing the initial transport stream isn't too much of a problem. 
> As somebody pointed out there are many streams transmitted on a single 
> frequency but there is some example DVB source code that shows how to get 
> the stream(s) you are interested in. It is not difficult to get to a 
> situation where you have a single MPEG stream (audio and video) that you 
> can output to a file or pipe or whatever. It is what you do with it 
> afterwards that is the problem. :)
I believe you can just use the dvbstream command to do this. Though you 
would need to write a wrapper that will look up the PID's of the video and 
audio streams and pass them to dvbstream. If you base this on channel.conf 
then this is pretty easy.
 
> 
> > The only problem then is to get this stream into a virtual v4l interface
> > ( if indeed this is possible ). I did look around on the web to try and
> > find out if it's possible to pipe a stream in this way but couldn't find
> > anything referring to similar stuff - if anyone knows how to do this I
> > will certainly test it out. I would also imagine there would be timing
> > and synchronising issues.
> 
> I'm new to this v4l stuff, I'm going to have to read up on it before I can
> comment on any of the above. But I don't know how synchronisation issues
> would occur since the audio and video in the initial MPEG stream are
> already synchronised. Wouldn't you have to work pretty hard to get them
> out of sync?
I think Matt was talking about decoding the MPEG stream, passing it to the 
video4linux interface and then myth using its standard mechanisms to 
reencode the data. This is horrendously inefficant BUT requires no (or 
virtually no) changes to Myth. If you did this the decoded audio and video 
streams might possibly get out of sync in the process.

If you go the route of modifying Myth to take in the piped data from
dvbstream (assuming you use it) and want to use the NUV file format then
there is another sync issue. I was slightly wrong earlier when I said that
I thought you'd have to parse each element stream to separate the frames,
you dont, NUV files can deal with bitstreams. BUT you would have to store
the video and audio streams in seperate frame types. This is easy, though
there are sync issues that you'll have to deal with (I doubt they are
particularly hard).

If you don't want to use the NUV file format then you are going to have to 
make pretty large changes to myth. I believe they will be orders of 
magnitude larger than the potential sync issues with using the NUV format. 

> > As I said in my previous mail the channel changing would require a script 
> > and a config file. The config file lists the channel frequencies on the 
> > dvb signal, and cross references them to the mythtv epg. This would need 
> > to be filled somehow by tv_grab_uk, or perhaps generated automatically by 
> > another script. The channel change script would then convert the mythtv 
> > channels to the correct frequency and call dvbtune.
> 
> This is not a problem. I've already sussed the tuning problems. I have 
> written/stolen some code that is able change channel on demand. And it 
> would be easy to incorporate this functionality in MythTV.
dvbtune already exists as a command line tool and will be the easiest
thing to use for channel changing. Myth already supports external command
line channel changers.

> 
> > However, even on the initial feedback to this post it certainly looks like 
> > there is some interest so here's hoping someone picks this up and runs 
> > with it. I'm available for testing, documentation and other non-programmer 
> > type stuff .....
> 
> If I could only get on top of the video stuff, I'd be well on the way...
As I said lib/libmythtv/Nuppel* contains almost everything related to 
video encoding and playback if you read through them that should be pretty 
much all you need to worry about. If you go down the route of taking data 
from a pipe into myth or writing proper DVB support into myth then you 
won't have to worry about the Video4Linux stuff at all. 

Good luck.

-- 
Richard King
E-mail: rak at cs.man.ac.uk



More information about the mythtv-dev mailing list