a good tip from our friends at pixeltools:


Glitch less looping provides restrictions on the MPEG encoding, the multiplexing, the server (or system that controls the MPEG stream looping) and the MPEG decoder. Your best chance at successful looping is to set up the elementary video decoder to have the identical starting and ending video buffer
Set the Optimize Encode | Rate Control | Final Buffer Fullness and Optimize Encode | Rate Control | Starting Buffer Fullness to be equal. You can use 20000 bytes as a starting number. Also, uncheck the Optimize Encode | Parameters | Sequence Style | End of Sequence. An end_of_sequence header will NOT be inserted at the end of the stream.
It is sometimes required to add stuffing packets in the Program or Transport streams between stream to compensate for irregularities in the server looping. Stuffing packets can be Transport packets with only stuffing bytes. Sometimes just adding a lot of 0x00s or 0xffs to between streams helps with glitching. You can experiment with your system to see how many stuffing bytes are useful.