Finding the place where a video loops
Try

ffmpeg -i video.mp4 -filter_complex
"[0]trim=start_frame=0:end_frame=1[c];[c][0]blend=all_mode=difference,blackframe" -f null -


As long as the very first frame of the video is not something like a static logo screen or similar, this should help you locate the loop joint. If it is, change the start frame value to a higher number. The end_frame should be 1 greater.  Basically, one instance of the video is trimmed to just one frame, then it's composited with the full video frame-by-frame, in difference mode. When the blend filter encounters an identical frame i.e. the point of loop, the result will be a black frame. The blackframe filter should then identify that frame (and all others at each loop turnover), with a readout looking like this:

[Parsed_blackframe_2 @ 0000000003607d20] frame:325 pblack:100 pts:13837 t:13.837000 type:I last_keyframe:325


That t value represents the duration of a single loop.