Patent attributes
An example embodiment of the present invention provides a process for inserting a source media stream into a target media stream, which media streams might be in container file format. The process opens and reads into memory structural information from a target media stream and structural information from a source media stream. The process then finds the nearest prior key frame to an insertion time and splits a chunk of media samples if the key frame's sample is not at the beginning of a chunk. The process adjusts the structural information for both streams in order to effect the mid-roll insertion of the source media stream into the target media stream. The process then writes onto an output media stream the adjusted structural information for the source and target media streams and then pipes onto the output media stream the media data for the source and target media streams.