Browse Source

obs-outputs: Prevent streaming HDR AV1/HEVC over RTMP

Currently unsupported by all remotes accepting enhanced RTMP. This
commit may be removed at a later date.
Yuriy Chumak 2 years ago
parent
commit
27dc30b672
1 changed files with 14 additions and 0 deletions
  1. 14 0
      plugins/obs-outputs/rtmp-stream.c

+ 14 - 0
plugins/obs-outputs/rtmp-stream.c

@@ -1422,6 +1422,20 @@ static void *connect_thread(void *data)
 		stream->start_dts_offset = get_ms_time(&packet, packet.dts);
 	}
 
+	// HDR streaming disabled for AV1 and HEVC
+	if (stream->video_codec != CODEC_H264) {
+		video_t *video = obs_get_video();
+		const struct video_output_info *info =
+			video_output_get_info(video);
+
+		if (info->colorspace == VIDEO_CS_2100_HLG ||
+		    info->colorspace == VIDEO_CS_2100_PQ) {
+			obs_output_signal_stop(stream->output,
+					       OBS_OUTPUT_HDR_DISABLED);
+			return NULL;
+		}
+	}
+
 	ret = try_connect(stream);
 
 	if (ret != OBS_OUTPUT_SUCCESS) {