[Live-devel] Matroska BANK_SIZE overflow

PROMONET Michel michel.promonet at thalesgroup.com
Fri Nov 8 07:20:50 PST 2013


            Hi Ross,

I continue to test mkv and I found another file that makes also abort testOnDemandRTSPServer.

You can download the test file http://dl.free.fr/uoSMgnOAg

Don't you think it could be kind to return instead of aborting, but perhaps it is not easy to throw up the overflow...

Best Regards,

            Michel.

[@@ THALES GROUP INTERNAL @@]

De : live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] De la part de PROMONET Michel
Envoyé : mercredi 6 novembre 2013 15:37
À : LIVE555 Streaming Media - development & use
Objet : Re: [Live-devel] Matroska BANK_SIZE overflow

            Hi Ross,

This is clearer like this.
Thank a lot.

Best Regards,

            Michel.

[@@ THALES GROUP INTERNAL @@]

De : live-devel-bounces at ns.live555.com<mailto:live-devel-bounces at ns.live555.com> [mailto:live-devel-bounces at ns.live555.com]<mailto:[mailto:live-devel-bounces at ns.live555.com]> De la part de Ross Finlayson
Envoyé : mercredi 6 novembre 2013 05:45
À : LIVE555 Streaming Media - development & use
Objet : Re: [Live-devel] Matroska BANK_SIZE overflow

Surely I badly use the matroska parser...
What I was trying to do is to connect each matroska subsession to a sink. In fact I don't need ServerMediaSession, it is just to get the FramedSource corresponding to a subsession.

The "MatroskaFileServerDemux" class should be used only within a RTSP server, in which case you don't 'play' the demultiplexed tracks directly; instead, this is done indirectly, via the RTSP server implementation.  I'm not sure exactly why the BANK_SIZE error was occurring for your application, but it turns out that you weren't using the API in the intended way.

If you want to demultiplex the tracks from a Matroska file directly - without a RTSP server - then you can do this; however, the API didn't make this clear.  That was my fault.

To fix this, I have installed a new version (2013.11.06) of the "LIVE555 Streaming Media" code that improves and clarifies the API for demultiplexing a Matroska file.

The following is a version of your demo application that uses the new, cleaned-up API to demultiplex a Matroska file into files for its constituent tracks.  (When I run this, I don't get the BANK_SIZE error.)

///////////////////////////
#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"

static char newMatroskaFileWatchVariable = 0;
static MatroskaFile* matroskaFile;
static void onMatroskaFileCreation(MatroskaFile* newFile, void* /*clientData*/) {
  matroskaFile = newFile;
  newMatroskaFileWatchVariable = 1;
}

int main(int argc, char** argv) {
  TaskScheduler* scheduler = BasicTaskScheduler::createNew();
  UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);

  // Open a Matroska file:
  char const* inputFileName = "test.mkv";
  MatroskaFile::createNew(*env, inputFileName, onMatroskaFileCreation, NULL);
  env->taskScheduler().doEventLoop(&newMatroskaFileWatchVariable);

  // Create a demultiplexor from the file:
  MatroskaDemux* demux = matroskaFile->newDemux();

  // And start copying each track:
  unsigned const fileSinkBufferSize = 300000;
  while (1) {
    unsigned trackNumber;
    FramedSource* trackSource = demux->newDemuxedTrack(trackNumber);
    if (trackSource == NULL) break;

    // For reference, display information about each track:
    MatroskaTrack* trackInfo = matroskaFile->lookup(trackNumber);
    fprintf(stderr, "Reading track %d, codec: %s\n", trackNumber, trackInfo->codecID);

    char outFileName[100];
    sprintf(outFileName, "track%d", trackNumber);
    MediaSink* sink = FileSink::createNew(*env, outFileName, fileSinkBufferSize, False);
    sink->startPlaying(*trackSource,NULL,NULL);
  }

  env->taskScheduler().doEventLoop();

  return 0;
}

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20131108/1b333115/attachment-0001.html>


More information about the live-devel mailing list