hi,
i'm not sure i exactly got your problem
in any case, it is very easy to create an rtsp streaming of mjpg into a browser from a pi camera
also, very easy to play rtsp, if you only intend on recording it i suggest you dont use KODI (why use kodi?)
contact me for more information