function ReplaceClipMod(clip base, clip alt, int start_base, int start_alt, int length)
{
Assert( !(start_base < 0 || start_alt < 0 || length < 1), "ReplaceClip: start must be the positive number")
Assert( !(FrameCount(base) < start_base + length), "ReplaceClip: length is too large (check the frame count of base)")
Assert( !(FrameCount(alt) < start_alt + length), "ReplaceClip: length is too large (check the frame count of alt)")

audio = KillVideo(base)

video = (length == 1) ? trim(alt, 0, -1) : trim(alt, start_alt, start_alt + length -1)
video = (start_base == 0) ? video : (start_base == 1) ? trim(base, 0, -1) + video : trim(base, 0, start_base -1) + video
video = (FrameCount(base) == (start_base + length)) ? video : video + trim(base, start_base + length, 0)

return HasAudio(base) ? AudioDub(video, audio) : KillAudio(video)
}