SHOT defines a continuous view filmed by one camera without interruption . Each shot is a take . ( if the setup is changed in any way - camera moved ,lens changed or different action filmed -it is a new shot ,not a retake )
SCENE defines the place or setting where the action is laid . A scene may consist of one shot or series of shots depicting a continuous event .
I have come across this a while back. I couldn’t really figure a clear cut method. But, There are a few ways you could do this.
PyScene detect is a good start. I believe the latest release came a few days ago. You could find it here.
https://github.com/Breakthrough/PySceneDetect
Also, if you are looking for a quick way to extract frames from a video file, you could use ffmpeg to extract intra-frames (iframes). I have found this works best.
In answer to your question, you could develop a simple script to get the time code of exact scene changing frames, and that the frames that follows until another scene changing frame comes up, can be counted as a shot.
This is what i have learnt so far, but im sure there are better ways. Please do let me know if you have come across any.