Techniques for seamlessly inserting a second compressed video stream (e.g., for an advertisement) into a first compressed video stream (e.g., for a program video), which can be implemented in an ad insertion processor (112) that typically includes a real time encoder (202a) (e.g., an MPEG encoder), a buffer (204a), a profiler (112), a multiplexer (112), and a splicer (112). The profiler receives the first compressed video stream and provides a 'profile' for the stream, which may include bit rate and other information about the stream. The real time encoder (202a) receives and encodes a second video in accordance with a particular encoding scheme to generate the second compressed video stream. The real time encoder further controls the encoding of the second video based at least in part on the profile of the first compressed video stream such that the profiles for the two streams are approximately similar at the point in time the second stream is inserted into the first stream. The buffer (204a) stores the first compressed video stream from the real time encoder until it is needed. The multiplexer inserts the second compressed video stream into the first compressed video stream, and the splicer splices the two streams together to form the output video stream.