The most basic way to measure velocity in to measure distance traveled in a known time. Here is a demonstration using a video camera with known frame rate. The velocity off the racket can be measured.
-----------------------------------------------------------------------------------------------------------
Here is a more direct and simpler way to measure serve speed. It also measures closer to the speed off the racket.
This was taken at 30 fps with the automatic exposure control selecting the shutter speed. In bright sunlight, the motion blur is workable - use the front or back of the ball or the center of the blur. Also, this was a somewhat telephoto lens not a wide angle lens as all smartphones have.
The camera views approximately perpendicular to the ball's trajectory where the intended measurement will be, here about 10 feet in front of the server.
The time between frames at 30 fps is 1/30 sec or 0.0333 seconds.
The problem is now simply to calibrate the distance along the trajectory. I could not do that here.
For your serve, you could just video a taught rope with black tape every 6" or 10 cm. Video a PVC pipe with tape every 6", etc. If no scale, just place your racket approximately on the ball's trajectory and video yourself as you walk along the trajectory. A little off, say, the racket is tilted 5 degrees to the trajectory, it does not make a big difference to the accuracy of your serve speed measurement.
If done with reasonable care this method can be more accurate than a radar gun.
-----------------------------------------------------------------------------------------------------------------------------
Example measurement using the ball as a scale.
If I use the ball itself as a crude scale on my computer screen I measure the ball blur to be about 3 mm across, in the direction perpendicular to the trajectory. Assuming the ball is 2.7" in diameter. Then a mm on my screen is 0.9" on the trajectory. If he had held his racket vertically or along the trajectory we could have used that as a more accurate scale.
In the first frame, on my computer screen, the back surface of the ball measures 88 mm from the pole.
In the second frame, it measures 5 mm from the pole.
(Since the camera was hand held and might have been moving the pole is used as a reference.)
The ball moved 88-5 = 83 mms from frame #1 to frame #2.
Converting 83 mm using the scale of 1 mm on the screen = 0.9" inches in real space.
The ball moved
83 mm X 0.9"/mm = 74.7 inches between frames.
74.7"/fr X 30 fr/sec = 2241"/sec
1 MPH = 17.6"/ sec
Video measured serve speed
2241/17.6 =
127 MPH
The radar gun measured
130 MPH.
The scale based on measuring the ball diameter is not accurate. The measurements just happened to come out close. I picked 2.7" as a ball diameter to demonstrate how to do a video measurement, not to evaluate the accuracy.
--------------------------------------------------------------------------------------------
Same principle but applying an interlaced video camera for timing. Not so many cameras have interlaced video anymore.