Hi there,
If you are fine with using opencv as recognition library I can create you a function where you pass an image (frame of the video) and get the xy coordinates, but I would recomment using c/c++ for the script - since I do not know if there is any possibility doing it directly in php, however, running an executable from php would be an opportunity...
Kind regards
Sebastian