My problem is that instead of sending with the right bitrate, this will stream as fast as it can to the network

When this happens, it's usually because your 'framer' object is not able to compute the duration of each Transport Packet (and so, each packet gets the default duration of 0). The reason for this is probably that your "MPEG2TransportStreamFramer" is not finding PCRs in the Transport Stream data.

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);

This looks good. However, you should first try just converting the Program Stream file into a Transport Stream file, e.g., using our "testMPEG1or2ProgramToTransportStream" demo application (whose code you have adapted).

I.e., first try to generate a Transport Stream file from your Program Stream file. Then, try to stream that file. That may give you some insight into what is going wrong.
--

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to