I need to split an RTSP feed into multiple files of 30 seconds. I have done
what has been suggested in the thread by sub-classing "QuickTimeFileSink"
and in the "QuickTimeFileSink::afterGettingFrame" ( after sync point )
re-open a new file without stopping the RTSP session.

I indeed get the data into multiple files of 30 seconds, BUT the stream
doesn't seem to be in the right spot to re-start the new files. So in
consequence only the first file is playable.

Snippet Regarding the un-playable file I feel a bit silly , but it was just missing the re-initialization of the "fHaveCompletedOutputFile = false" to write the footer
and voila.

Having said that, I still have the problem of not starting the next files at the
right spot I believe. When I play them I have a few seconds where nothing
moves before to pick up what I suppose is a key frame.
So in "QuickTimeFileSink::afterGettingFrame" this is what I do : Snippet Snippet

void  QuickTimeFileSink
::afterGettingFrame(void* clientData,unsigned  packetDataSize,
                unsigned  /*numTruncatedBytes*/,
                struct  timeval presentationTime,
                unsigned  /*durationInMicroseconds*/) {
  SubsessionIOState* ioState = (SubsessionIOState*)clientData;
  if  (!ioState->syncOK(presentationTime)) {
    // Ignore this data:
    ioState->fOurSink.continuePlaying();
    return;
  }

  // [my-code]
  Boolean keyFrame = (ioState->fBuffer &&
        *(ioState->fBuffer->dataStart()) == H264_IDR_FRAME);
  ioState->fOurSink.afterGettingFrame1(
        packetDataSize, presentationTime, keyFrame);
  // [/my-code]

  ioState->afterGettingFrame(packetDataSize, presentationTime);
}

"afterGettingFrame1" is the handler in my subclassed QuickTimeFileSink
class I use to do the file close/re-open when the "keyFrame = true" and
the 30 seconds elapsed.

But for some reasons, this doesn't work.

Any ideas why ?

Many thanks in advance.
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to