Use OBS's obs_source_info structure:
void processH264Packet(uint8_t* data, int len) // Simplified: assemble NAL units // For FU-A: combine FU indicator + FU header + payload // Send to decoder (e.g., FFmpeg, OpenH264)
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);
RTSPVideoPlugin() = default; ~RTSPVideoPlugin() stop();
public: bool open(const char* rtspUrl) avformat_network_init(); AVDictionary* opts = nullptr; av_dict_set(&opts, "rtsp_transport", "tcp", 0); // TCP for reliability av_dict_set(&opts, "max_delay", "500000", 0);
Rtspvideoplugin 2021 -
Use OBS's obs_source_info structure:
void processH264Packet(uint8_t* data, int len) // Simplified: assemble NAL units // For FU-A: combine FU indicator + FU header + payload // Send to decoder (e.g., FFmpeg, OpenH264) rtspvideoplugin
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); .type = OBS_SOURCE_TYPE_INPUT
RTSPVideoPlugin() = default; ~RTSPVideoPlugin() stop(); .output_flags = OBS_SOURCE_VIDEO
public: bool open(const char* rtspUrl) avformat_network_init(); AVDictionary* opts = nullptr; av_dict_set(&opts, "rtsp_transport", "tcp", 0); // TCP for reliability av_dict_set(&opts, "max_delay", "500000", 0);