Fandome offers a fascinating 3 1/2 minute video explaining how the first-down line on football broadcasts* actually works. Evidently, there's a lot of processing to calculate the exact location being photographed on the field, and a lot more to draw a line in exactly** the right place.
*In American football, a team is allotted four plays to advance the ball at least 10 yards total, where a yard is approximately .9 meters. If it achieves this, it is said to have gotten a "first down."
**Actually, football fans often claim that the line is off by a foot or two now and then.
- "Pan" and "tilt" are measured by optical sensors right on the camera.
- Focus and two kinds of zoom are measured by connectors to the existing digital outputs of the camera.
- This is all then encoded into a modem-like audio stream.
- It is eventually re-encoded into dots at the top of the frames in the video stream.
- That then gets to a computer, where it is processed to create the actual image of the line.
- For the line to appear to be under the players, it has to be drawn only on images of the field but not on images of the players. That's based on color filters, which are straightforward on clear, sunny days, but harder to get right in fog, snow, or mud.
Edit: A longer, several-years-old (I think) write-up makes further points:
- The system has to know the orientation of the field with respect to the camera so that it can paint the first-down line with the correct perspective from that camera's point of view.
- The system has to know, in that same perspective framework, exactly where every yard line is.
- Given that the cameraperson can move the camera, the system has to be able to sense the camera's movement (tilt, pan, zoom, focus) and understand the perspective change that results from the movement.
- Given that the camera can pan while viewing the field, the system has to be able to recalculate the perspective at a rate of 30 frames per second as the camera moves.
- A football field is not flat -- it crests very gently in the middle to help rainwater run off. So the line calculated by the system has to appropriately follow the curve of the field.
- A football game is filmed by multiple cameras at different places in the stadium, so the system has to do all of this work for several cameras.
- The system has to be able to sense when players, referees or the ball cross over the first-down line so it does not paint the line right on top of them.
- The system also has to be aware of superimposed graphics that the network might overlay on the scene.
Some of the details in that article differ from those in the video, but the general idea is the same.