How to use computer vision to find corners of a soccer field based on location coordinates?
Finding lines in an image often leads to the Hough line transform. Many libraries implement it, including OpenCV. Getting the lines should answer subsequent questions (and it doesn't, please consider having one question per post, and some other sites on StackExchange may be better suited than AI.SE).

Alternative approaches based on Machine Learning may also exist. It may be interesting at this point to look into libraries that do human pose/gait recognition. Some library may be repurposed to recognize the "field gait", assuming the field outer mark is its "gait"-equivalent.