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

Commit

Permalink
Fix the last of the hardcoding and simpified UI for Charon enabled OBS
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Casadevall <michael@beam.pro>
Michael Casadevall committed Feb 4, 2016
1 parent 5a15e10 commit 967c5b0
Showing 4 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion obs/data/locale/en-US.ini
Original file line number Diff line number Diff line change
@@ -409,7 +409,7 @@ Basic.Settings.Output.Adv.FFmpeg.ChannelID="Beam Channel ID"
Basic.Settings.Output.Adv.FFmpeg.StreamKey="Stream Authentication Key"
Basic.Settings.Output.Adv.FFmpeg.AudioSSRC="Audio SSRC"
Basic.Settings.Output.Adv.FFmpeg.VideoSSRC="Video SSRC"

Basic.Settings.Output.Adv.FFmpeg.IngestLoc="Ingest Location"I'm
# basic mode 'video' settings
Basic.Settings.Video="Video"
Basic.Settings.Video.Adapter="Video Adapter:"
6 changes: 5 additions & 1 deletion obs/forms/OBSBasicSettings.ui
Original file line number Diff line number Diff line change
@@ -428,7 +428,11 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="advOutFTLChannelId"/>
<widget class="QSpinBox" name="advOutFTLChannelId">
<property name="maximum">
<number>1000000</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
3 changes: 3 additions & 0 deletions obs/obs-app.cpp
Original file line number Diff line number Diff line change
@@ -1315,9 +1315,11 @@ static void move_to_xdg(void)

static bool update_ffmpeg_output(ConfigFile &config)
{
return false;
// if (config_has_user_value(config, "AdvOut", "FFOutputToFile"))
// return false;

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

static bool move_reconnect_settings(ConfigFile &config, const char *sec)
24 changes: 21 additions & 3 deletions plugins/obs-ffmpeg/obs-ffmpeg-output.c
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
#include "obs-ffmpeg-compat.h"

struct ffmpeg_cfg {
const char *url;
char url[2048];
const char *format_name;
const char *format_mime_type;
char audio_muxer_settings[2048];
@@ -55,6 +55,7 @@ struct ffmpeg_cfg {
int height;

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

settings = obs_output_get_settings(output->output);
config.url = obs_data_get_string(settings, "url");
config.ingest_location = get_string_or_null(settings, "url");
config.format_name = get_string_or_null(settings, "format_name");
config.format_mime_type = get_string_or_null(settings,
"format_mime_type");
@@ -1062,6 +1063,23 @@ static bool try_connect(struct ffmpeg_output *output)
return false;
}

/* Build the RTP command line */
if (config.ingest_location == NULL) {
blog(LOG_WARNING, "ingest location blank");
return false;
}

if (config.stream_key == NULL) {
blog(LOG_WARNING, "stream key incorrect");
return false;
}

size = snprintf(config.url, 2048, "rtp://%s:8082?pkt_size=1420", config.ingest_location);
if (size == 2048) {
blog(LOG_WARNING, "snprintf failed on URL");
return false;
}

if (format_is_yuv(voi->format)) {
config.color_range = voi->range == VIDEO_RANGE_FULL ?
AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
@@ -1090,7 +1108,7 @@ static bool try_connect(struct ffmpeg_output *output)
return false;
}

ftl_set_ingest_location(output->stream_config, "127.0.0.1");
ftl_set_ingest_location(output->stream_config, config.ingest_location);
ftl_set_authetication_key(output->stream_config, config.channel_id, config.stream_key);

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

0 comments on commit 967c5b0

Please sign in to comment.