[Live-devel] Read from device file problem

Gordon Smith spider.karma+live555.com at gmail.com
Thu Apr 2 16:42:01 PDT 2009


>   $ sudo ./testMPEG2TransportStreamer /dev/video2
>
> I still get data loss after a few minutes with direct read, but that
> may be a problem with the device module.

I now see that overflow occurs in the encoder device module (zero free buffers).

I see in ByteStreamFileSource.cpp that "fPreferredFrameSize" fits an
integral number of MPEG-2 TS packets into the MTU.

If I remove the the following in ByteStreamFileSource.cpp:

    // Try to read as many bytes as will fit in the buffer provided
    // (or "fPreferredFrameSize" if less)
    if (fPreferredFrameSize > 0 && fPreferredFrameSize < fMaxSize) {
        fMaxSize = fPreferredFrameSize;
    }

and read as much data as is available,
12032 bytes (64 * 188) are read at a time instead of the usual 1316 (7 * 188).

Would a larger MTU likely help? Would that be moving into new
territory codewise?

Thanks for any pointers,
Gordon


More information about the live-devel mailing list