[Live-devel] PES to Transport Stream Framer

Ionut Cotoi icotoi at rolabs.com
Mon Jul 21 07:53:28 PDT 2008


Hi,
I am trying to write a little application that reads an Program 
Elementary Stream from a file, puts it trough a transport stream 
multiplexer and sends it over UDP.
My problem is that instead of sending with the right bitrate, this will 
stream as fast as it can to the network and overflow VLC. If I feed the 
MPEG2TransportStreamFramer from a ts file everything works ok.
Can anyone give me a hint on what I am not doing right?


What I do is basically this:
{
    ByteStreamFileSource* fileSource
    = ByteStreamFileSource::createNew(*env, inputFileName);
  if (fileSource == NULL) {
    *env << "Unable to open file \"" << inputFileName
     << "\" as a byte-stream file source\n";
    exit(1);
  }
  MPEG2TransportStreamFromPESSource* tsFrames;
  MPEG2TransportStreamFramer* tsFramer;
    FramedSource* esVideoSource;
   

    MPEG1or2Demux* baseDemultiplexor = MPEG1or2Demux::createNew(*env, 
fileSource);

    MPEG1or2DemuxedElementaryStream *videoES = 
baseDemultiplexor->newRawPESStream();

    tsFrames = MPEG2TransportStreamFromPESSource::createNew(*env, videoES);

    tsFramer = MPEG2TransportStreamFramer::createNew(*env, tsFrames);


  // Finally, start playing:
  *env << "Beginning to read from file...\n";
  videoSink->startPlaying(*tsFramer, afterPlaying, videoSink);

}

Best regards,
Ionut Cotoi



More information about the live-devel mailing list