[Live-devel] Problem using MPEG2TransportStreamFramer

Santiago Merchán smerchan at gruposamtel.com
Mon Jan 17 11:12:04 PST 2011


Hello again,

Thank you very much for your fast reply. I will try to explain better what we have done.

We had to rewrite the class MPEG2TransportStreamFramer because Android doesn´t support C++ applications. We could have tried a JNI wrapper to the c++ class but as it was only a class, we decided to rewrite it. Our code in JAVA is exactly the same as yours in C++, except the things JAVA does not support, as unsigned types and so on.

Anyway, our simple question is about the behaviour of your code. If we understood well, this code tries to estimate the duration of a packet, so you know the duration for the 7 packets you are sending, but we don´t know what do you do with that number. Do you sleep your sending thread that amount of time? How do you wait for the player to receive the packets? Is this in the afterGetting function?

This is your code :

  struct timeval tvNow;
  gettimeofday(&tvNow, NULL);
  double timeNow = tvNow.tv_sec + tvNow.tv_usec/1000000.0;
  for (unsigned i = 0; i < numTSPackets; ++i) {
    updateTSPacketDurationEstimate(&fTo[i*TRANSPORT_PACKET_SIZE], timeNow);
  }

  fDurationInMicroseconds
    = numTSPackets * (unsigned)(fTSPacketDurationEstimate*1000000);

  // Complete the delivery to our client:
  afterGetting(this);

We checked that changing the value of MAX_PLAYOUT_BUFFER_DURATION from 0.1 to 0.001 made the video and audio work smoother in the STB. But we have a lot of differences playing ts files with different codecs. We suspect we should take the file bitrate into account, but we don´t know how to relate this to the ts PCRs. Please provide us some help to be able to finish our project.

Kind Regards.
Fdo: Santiago Merchán
Grupo Samtel
Telf: 91 426 48 75
Fax: 91 431 05 73
La información incluida en el presente correo electrónico es CONFIDENCIAL, siendo para el uso exclusivo del destinatario arriba mencionado.








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20110117/6ca5ed30/attachment.html>


More information about the live-devel mailing list