[Live-devel] loosing information when parse a frame and fMaxsize is less than frame size

Manuel Jesus Nogales mnogales at vdx.es
Thu Nov 30 02:26:14 PST 2006


Ross Finlayson escribió:
> If your encoder delivers discrete MPEG (1 or 2) video frames, rather 
> than an unstructured byte stream, then you should use 
> "MPEG1or2VideoStreamDiscreteFramer" rather than 
> "MPEG1or2VideoStreamFramer".  This will be more efficient, because 
> you won't need to parse through the input data.
>
> But if you still want to use "MPEG1or2VideoStreamFramer", then you 
> *may* be able to solve your problem by increasing BANK_SIZE in 
> "StreamParser.cpp".
>   
Hello

I have suppoused that changing the BANK_SIZE is not the way, cause I 
will have the same problems with 100000 or 150000 or 200000.
In my "myByteStreamBufferSource::doGetNextFrame()", I parse to fTo a 
number of bytes of the encoded frame of that moment (the encoded frame 
comes from myEncoderMPEG that encode to MPEG1 the live captures of my 
camera). The number of bytes is different for each frame, but never is 
greater to 10000 bytes.

As I undestand in every call of doGetNextFrame the number of fMaxSize is 
reduced by fFrameSize every time, and when I have parsed the last bytes 
to fTo, for the next time is called doGetNextFrame, fMaxSize is reloaded 
to 150000. I suppouse StreamParser do that, changing fTo to point 
another buffer ("bank") with size 150000. My question is, How can I 
force the "reload" of the value of fMaxSize (rewind the fTo) when 
fFrameSize is gratter than fMaxSize? In case it will does not possible, 
what can I do with the fNumTruncatedBytes? It will be possible to send 
it to fTo, in order of does not lose any information?

If I use MPEG1or2VideoStreamDiscreteFramer, what must I change on my 
"class myByteStreamBufferSource: public FramedSource"? Can anybody tell 
where to find any example?

Thanks in advance,


More information about the live-devel mailing list