Watch the angle readout at the top of the video. The rotation of the object happens exactly around the time that the angle passes 0°. Why is this?
Have you ever watched a PTZ security camera rotate up and over the vertical axis and down the other side? It will tilt up until it nears the vertical axis, at which point it will rotate around that axis, and then tilt back down, now facing the other way. It does this to avoid gimbal lock [1], a state in which it would lose a degree of freedom of rotation. (In this case, it's not the vertical axis, but the forward axis.)
Why doesn't the image rotate then? [shallow speculation] The video software keeps it oriented so that it matches the plane's orientation. (Note that the feed is square, making it easier to make full use of the sensor regardless of rotation.)
Why does the object rotate? This should give you a clue where the object is. If the background is not rotating while the camera is rotating, but the object is, the object is on the camera. It will appear to rotate as the video software rotates the image to compensate for the camera rotation about the forward axis.
So why is the object moving? Well, it's not moving, not if it's on the camera. But whenever the camera moves, it would look like it's moving relative to the background.
So why is the camera moving? It's tracking the object. But the object isn't moving! Well, the camera doesn't track movement. It tracks position. The object is slightly offset from the center of the frame, so the tracking software slightly moves the camera to compensate. This of course does not change the situation, so the tracking software repeats its compensation. This constant camera movement in a single direction gives the appearance that the object is moving.
Why does the object show up on an infrared camera in the first place? It must be warm.
So… what is this warm object, which is stuck on the camera, slightly off-center, causing the tracking software to follow it, through and around the camera's axis, giving the appearance that the object is moving and then rotating?
Well, it's the same thing as this article in the NY Times, which, in service of securing funding from the UFO & Hitler Channel (as @floatrock astutely noted), decided to lend its gravitas to an easily-explainable video glitch which has been paraded by conspiracy theorists as incontrovertible validation of their deepest-held beliefs that extraterrestrials, against all probability, regularly visit Earth.
Bird shit.
Why am I paying for a NY Times subscription again?