Skip to content

Commit

Permalink
obs-ffmpeg: Remove mpegts format override for SRT and RIST
Browse files Browse the repository at this point in the history
FFmpeg is already very effective at detecting the correct input format
for socket-style protocols (SRT, RIST, TCP, UDP, etc.). By overriding
the format of SRT and RIST manually to mpegts, the user is being
prevented from using other container formats via these protocols.

In the rare case that libavformat is unable to detect the correct
container format for an SRT or RIST stream, the user may manually
specify that format in the existing format field.

With the FFmpeg options field which was recently added, probe options
may be specified by the user to further tune format detection.
  • Loading branch information
tt2468 authored and RytoEX committed Apr 10, 2024
1 parent 15b5dae commit 3d30a4e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions plugins/obs-ffmpeg/obs-ffmpeg-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,8 @@ static void ffmpeg_source_tick(void *data, float seconds)
}
}

#define SRT_PROTO "srt"
#define RIST_PROTO "rist"

static bool requires_mpegts(const char *path)
{
return !astrcmpi_n(path, SRT_PROTO, sizeof(SRT_PROTO) - 1) ||
!astrcmpi_n(path, RIST_PROTO, sizeof(RIST_PROTO) - 1);
}

static void ffmpeg_source_update(void *data, obs_data_t *settings)
{
struct ffmpeg_source *s = data;
Expand Down Expand Up @@ -468,10 +461,6 @@ static void ffmpeg_source_update(void *data, obs_data_t *settings)
should_restart_media = true;
input = obs_data_get_string(settings, "input");
input_format = obs_data_get_string(settings, "input_format");
if (requires_mpegts(input)) {
input_format = "mpegts";
obs_data_set_string(settings, "input_format", "mpegts");
}
s->reconnect_delay_sec =
(int)obs_data_get_int(settings, "reconnect_delay_sec");
s->reconnect_delay_sec = s->reconnect_delay_sec == 0
Expand Down

0 comments on commit 3d30a4e

Please sign in to comment.