[Live-devel] Received Frames not written.

Ross Finlayson finlayson at live.com
Mon Jun 27 00:53:35 PDT 2005


>I am using mpeg4 encoder (ffmpeg coder), essentially .m4v file. I have not
>noticed this loss when there is no loss due to network at all.

The current code doesn't handle packet loss in incoming MPEG-4 RTP streams 
as well as it could.  In particular, if the last packet of a fragmented 
frame (indicated by the RTP "M" bit) is lost, then the packets that make up 
the next frame will be discarded also.

Try making the following change, which I think will improve things:

In "MPEG4ESVideoRTPSource.cpp", line 49:

Replace:
         fCurrentPacketBeginsFrame = fCurrentPacketCompletesFrame;
                 // whether the *previous* packet ended a frame
with
         fCurrentPacketBeginsFrame
                 = fCurrentPacketCompletesFrame // the *previous* packet 
ended a frame
                 || (packet->dataSize() >= 4 && (packet->data())[0] == 0
                     && (packet->data())[1] == 0 && (packet->data())[2] == 1);

Please let us know if that makes a difference.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list