Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit 967c5b0

Browse files
author
Michael Casadevall
committed
Fix the last of the hardcoding and simpified UI for Charon enabled OBS
Signed-off-by: Michael Casadevall <michael@beam.pro>
1 parent 5a15e10 commit 967c5b0

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

obs/data/locale/en-US.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Basic.Settings.Output.Adv.FFmpeg.ChannelID="Beam Channel ID"
409409
Basic.Settings.Output.Adv.FFmpeg.StreamKey="Stream Authentication Key"
410410
Basic.Settings.Output.Adv.FFmpeg.AudioSSRC="Audio SSRC"
411411
Basic.Settings.Output.Adv.FFmpeg.VideoSSRC="Video SSRC"
412-
412+
Basic.Settings.Output.Adv.FFmpeg.IngestLoc="Ingest Location"I'm
413413
# basic mode 'video' settings
414414
Basic.Settings.Video="Video"
415415
Basic.Settings.Video.Adapter="Video Adapter:"

obs/forms/OBSBasicSettings.ui

+5-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,11 @@
428428
</widget>
429429
</item>
430430
<item row="1" column="1">
431-
<widget class="QSpinBox" name="advOutFTLChannelId"/>
431+
<widget class="QSpinBox" name="advOutFTLChannelId">
432+
<property name="maximum">
433+
<number>1000000</number>
434+
</property>
435+
</widget>
432436
</item>
433437
<item row="2" column="0">
434438
<widget class="QLabel" name="label_9">

obs/obs-app.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1315,9 +1315,11 @@ static void move_to_xdg(void)
13151315

13161316
static bool update_ffmpeg_output(ConfigFile &config)
13171317
{
1318+
return false;
13181319
// if (config_has_user_value(config, "AdvOut", "FFOutputToFile"))
13191320
// return false;
13201321

1322+
#if 0
13211323
const char *url = config_get_string(config, "AdvOut", "FFURL");
13221324
if (!url)
13231325
return false;
@@ -1350,6 +1352,7 @@ static bool update_ffmpeg_output(ConfigFile &config)
13501352
config_set_string(config, "AdvOut", "FFExtension", extension.c_str());
13511353
config_set_bool(config, "AdvOut", "FFOutputToFile", true);
13521354
return true;
1355+
#endif
13531356
}
13541357

13551358
static bool move_reconnect_settings(ConfigFile &config, const char *sec)

plugins/obs-ffmpeg/obs-ffmpeg-output.c

+21-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "obs-ffmpeg-compat.h"
3434

3535
struct ffmpeg_cfg {
36-
const char *url;
36+
char url[2048];
3737
const char *format_name;
3838
const char *format_mime_type;
3939
char audio_muxer_settings[2048];
@@ -55,6 +55,7 @@ struct ffmpeg_cfg {
5555
int height;
5656

5757
/* FTL specific fields */
58+
const char *ingest_location;
5859
uint32_t channel_id;
5960
const char *stream_key;
6061
uint32_t audio_ssrc;
@@ -1030,7 +1031,7 @@ static bool try_connect(struct ffmpeg_output *output)
10301031
int ret;
10311032

10321033
settings = obs_output_get_settings(output->output);
1033-
config.url = obs_data_get_string(settings, "url");
1034+
config.ingest_location = get_string_or_null(settings, "url");
10341035
config.format_name = get_string_or_null(settings, "format_name");
10351036
config.format_mime_type = get_string_or_null(settings,
10361037
"format_mime_type");
@@ -1062,6 +1063,23 @@ static bool try_connect(struct ffmpeg_output *output)
10621063
return false;
10631064
}
10641065

1066+
/* Build the RTP command line */
1067+
if (config.ingest_location == NULL) {
1068+
blog(LOG_WARNING, "ingest location blank");
1069+
return false;
1070+
}
1071+
1072+
if (config.stream_key == NULL) {
1073+
blog(LOG_WARNING, "stream key incorrect");
1074+
return false;
1075+
}
1076+
1077+
size = snprintf(config.url, 2048, "rtp://%s:8082?pkt_size=1420", config.ingest_location);
1078+
if (size == 2048) {
1079+
blog(LOG_WARNING, "snprintf failed on URL");
1080+
return false;
1081+
}
1082+
10651083
if (format_is_yuv(voi->format)) {
10661084
config.color_range = voi->range == VIDEO_RANGE_FULL ?
10671085
AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
@@ -1090,7 +1108,7 @@ static bool try_connect(struct ffmpeg_output *output)
10901108
return false;
10911109
}
10921110

1093-
ftl_set_ingest_location(output->stream_config, "127.0.0.1");
1111+
ftl_set_ingest_location(output->stream_config, config.ingest_location);
10941112
ftl_set_authetication_key(output->stream_config, config.channel_id, config.stream_key);
10951113

10961114
output->video_component = ftl_create_video_component(FTL_VIDEO_VP8, 96, config.video_ssrc, config.scale_width, config.scale_height);

0 commit comments

Comments
 (0)