[Live-devel] Read multiple frames?

Julian Lamberty julian.lamberty at mytum.de
Sun May 27 13:12:47 PDT 2007


Hi!

I've subclassed FramedFilter to transcode a MPEG2 Stream (from 
vobStreamer) to MPEG4.

My "live-chain" is: MPEG1or2VideoRTPSource -> Transcoder -> FileSink

I use the following code:

void Transcoder::doGetNextFrame() {
    fInputSource->getNextFrame(fOrg, 4096, afterGettingFrame, this, 
handleClosure, this);
}

void Transcoder::afterGettingFrame(void* ClientData, unsigned 
numBytesRead, unsigned numTruncatedBytes, struct timeval 
presentationTime, unsigned durationIn Microseconds) {
    Transcoder* transcoder = (Transcoder*)clientData;
    transcoder->afterGettingFrame1(numBytesRead, numTruncatedBytes, 
presentationTime, durationIn Microseconds);
}

void Transcoder::afterGettingFrame1(unsigned numBytesRead, unsigned 
numTruncatedBytes, struct timeval presentationTime, unsigned durationIn 
Microseconds) {
    size = numBytesRead;
    while(size > 0) {
       ...ffmpeg stuff (reads from fOrg, shall decode a frame and on 
success sets got_frame = 1)...
    }
    size -= dec_bytes;
    fOrg += dec_bytes;
}

All the above functions get porperly called when I start the program, 
but the problem is that the ffmpeg decoder does not get enough data when 
the MPEG1or2VideoRTPSource::getNextFrame() is just called one time. size 
== 0 in this case but the frame can't be completely decoded. 
numBytesRead is between 700 and 1500 Bytes every time (seems too small 
imho). How do I obtain more data from the Source until I can decode one 
frame? Shouldn't MPEG1or2VideoRTPSource deliver exactly ONE VIDEO FRAME?

What am I doing wrong?

Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5198 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.live555.com/pipermail/live-devel/attachments/20070527/cd44e92a/attachment.bin 


More information about the live-devel mailing list