That's nothing that you can do with only motion tracking. You will quite likely need corrective warping using distortion effects and also of course timewarping to adjust the timing. Either way, without seeing teh footage noboy will be able to advise specifically.
Here's what I would do for part 1
- Pick the edit point where you want to transition between the two clips
- choose the number of frames you want to use for the transition
- Split the leading clip at the start of the transition
- Set the out point of the leading clip to the end of the transition
- Set the in point of the following clip at the start of the transition
- Split the following clip at the end of the transition
- Select the transition portion of both clips and pre-compose the clips trimming the pre-comp to the length of the selected clips
Now you have two short clips in a pre-comp that you can monkey with to make the transition work as seamlessly as you can. It is important to note that these two sections of the transition do not need to be the same length. If the transition part of the leading clip is 60 frames long and the transition part of the trailing clip is 50 frames long then that is OK and you can match them up by shortening the longer clip using time remapping. Once both sections are the same length you set up the alignment by stabilizing both shots using AE's tracker. If there is a perspective shift then you'll have to track position, scale and rotation. In your shot you describe a window or a TV screen that you want to match up. You want to end up with the area of interest stabilized so that it doesn't move on the screen. You do this one shot at a time by hiding the shot on the top layer.
Now comes the likening up part. Add a null to the comp and make it the parent of the top layer. Set the blend mode of the top shot to difference or screen, or overlay so you can see the difference between the top shot and the bottom shot. Now line up the two TV screens by moving the null. Once both shots are lined up change the blend mode back to normal and animate the opacity of the top layer to complete the transition.
The last part of the process is to remove the stabilization by adding two nulls, one for the top layer and one for the bottom layer. You'll tie the Anchor point of the stabilized layer to the position property of the Null using just the pickwhip. If you tracked scale and rotation you'll need to add an expression to the rotation and the scale property of the null that point to the stabilized layer. After the expressions are added you parent the stabilized layer to the null for that layer and you're done.
Here are the expressions for the null if the layer is named "stablizied':
x = value;
y = value;
tx = thisComp.layer("stabilized").transform.scale;
ty = thisComp.layer("stabilized").transform.scale;
nx = x/tx*x;
ny = y/ty*y;
I would suggest that you save these expressions as an animation preset.
The last step is to scale the top layer and move it using the first null you added so that the overlay is perfect. There may be some masking required and you may have to scale the shots from beginning to end to keep the shots full frame.