Stepper motor strange behavior (video included)

The ancient piece of crap L298 DC motor driver is a totally inappropriate driver for a modern bipolar stepper motor. You should acquire a proper current controlling stepper driver. Pololu has a good line of modern stepper drivers. Choose a driver that can handle the stepper supply voltage and supply the coil current required by the motor. The motor data sheet should list the max coil current. Set the coil current limit on the driver before connecting the motor.

NEMA23 only tells us the mounting dimensions, nothing of the current requirements of the motor or anything else.

If you want help here, post photos here so that we do not have to go and download them.

Please post the test code.
Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.