[Live-devel] Please help me to understand how I can retrieve the Frame Width, Frame Height and Frame Type (I or P frame).
Michael Margold
admin at soft-collection.com
Fri Nov 20 23:11:12 PST 2015
Hello!
Thank you very much for this project!
Please help me to understand how I can retrieve the Frame Width, Frame
Height and Frame Type (I or P frame).
My code example is based on testRTSPClient.cpp
I am in the function DummySink::afterGettingFrame
fSubsession.videoWidth() and fSubsession.videoHeight() always return 0.
All other parameters works fine.
I have h264 video.
Please help!
Thank you!
void DummySink::afterGettingFrame(unsigned frameSize, unsigned
numTruncatedBytes, struct timeval presentationTime, unsigned
/*durationInMicroseconds*/)
{
if (mAudioVideoIn != NULL)
{
mAudioVideoIn->OnFrameReceived(fStreamId,
fSubsession.mediumName(), fSubsession.codecName(), fReceiveBuffer,
frameSize, fSubsession.videoWidth(), fSubsession.videoHeight(), 0);
}
// We've just received a frame of data. (Optionally) print out
information about it:
#ifdef DEBUG_PRINT_EACH_RECEIVED_FRAME
if (fStreamId != NULL) envir() << "Stream \"" << fStreamId << "\"; ";
envir() << fSubsession.mediumName() << "/" << fSubsession.codecName()
<< ":\tReceived " << frameSize << " bytes";
if (numTruncatedBytes > 0) envir() << " (with " << numTruncatedBytes
<< " bytes truncated)";
char uSecsStr[6 + 1]; // used to output the 'microseconds' part of
the presentation time
sprintf(uSecsStr, "%06u", (unsigned)presentationTime.tv_usec);
envir() << ".\tPresentation time: " << (int)presentationTime.tv_sec
<< "." << uSecsStr;
if (fSubsession.rtpSource() != NULL &&
!fSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP())
{
envir() << "!"; // mark the debugging output to indicate that
this presentation time is not RTCP-synchronized
}
#ifdef DEBUG_PRINT_NPT
envir() << "\tNPT: " <<
fSubsession.getNormalPlayTime(presentationTime);
#endif
envir() << "\n";
#endif
// Then continue, to request the next frame of data:
continuePlaying();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20151121/766a2377/attachment.html>
More information about the live-devel
mailing list