[mythtv] memory buffer for live video video stream

Daniel Kristjansson danielk at cuymedia.net
Sun Nov 12 02:10:40 UTC 2006

On Sun, 2006-11-12 at 01:49 +0000, Martin Long wrote:
> > Actually mythv even when you are watching live TV get the stream from 
> > capture or dvb card, writes the stream to disk in a file, then the 
> > frontend asks for data from this file to the backend.
> > I believe that when watching live TV with a small lag from real time, 
> > the backend could feed the frontend with data coming from ram instead of 
> > Reading on disk.
> Well... this is provided by linux (and pretty much any OS). A think called
> the buffer cache uses almost all of the free RAM (leaving a couple of meg
> free), all writes are written to this before being written to the disk, then

Yup, this happens whether you are running the frontend on the same
host or over NFS/CIFS, so the OS actually does all of this and more..

To speed up LiveTV we need to make the NVP or avlib smarter about
handling partial frames. Right now we can get stuck a long time if
we don't have enough data to feed avlib a whole video frame. Because
of this, we are more conservative in our buffering that we otherwise
would need to be. We could also do better if we had a better estimate
of the bitrate. At the moment we trust what avlib's estimate at
the beginning of decoding, but this estimate is often inaccurate
and we don't ever refine this estimate based on the actual bitrate.
This causes a long delay at starting up when the bitrate is
significantly less than we expected.

-- Daniel

More information about the mythtv-dev mailing list