top of page

Rtspvideoplugin [repack] -

int m_rtpSocket; std::thread m_thread; bool m_running = false; std::string m_url; FrameCallback m_callback; ; extern "C" #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h>

def start(self): self.cap = cv2.VideoCapture(self.url, cv2.CAP_FFMPEG) # Set options self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1) self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('H','2','6','4')) self.running = True Thread(target=self._update, daemon=True).start() def _update(self): while self.running: ret, self.frame = self.cap.read() if not ret: self.cap.release() self.cap = cv2.VideoCapture(self.url) # Reconnect def get_frame(self): return self.frame rtspvideoplugin

RTSPVideoPlugin() = default; ~RTSPVideoPlugin() stop(); bool m_running = false

struct obs_source_info rtsp_source = .id = "rtsp_video_source", .type = OBS_SOURCE_TYPE_INPUT, .output_flags = OBS_SOURCE_VIDEO, .get_name = rtsp_name, .create = rtsp_create, .destroy = rtsp_destroy, .video_render = rtsp_video_render, .get_properties = rtsp_properties, .update = rtsp_update ; static void rtsp_video_render(void* data, gs_effect_t* effect) struct rtsp_data rtsp = (struct rtsp_data )data; if (rtsp->texture) obs_source_draw(rtsp->texture, 0, 0, 0, 0, false); extern "C" #include &lt

bottom of page