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

Commit 6a6ffd6

Browse files
committed
added ifdef for h.264 and vp8
1 parent 745246c commit 6a6ffd6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ ftl_status_t attempt_ftl_connection(struct ffmpeg_output *output, struct ffmpeg_
201201
ftl_set_ingest_location(output->stream_config, config.ingest_location);
202202
ftl_set_authetication_key(output->stream_config, config.channel_id, config.stream_key);
203203

204+
#ifdef _FTL_USE_H264
204205
output->video_component = ftl_create_video_component(FTL_VIDEO_H264, 96, config.video_ssrc, config.scale_width, config.scale_height);
206+
#else
207+
output->video_component = ftl_create_video_component(FTL_VIDEO_VP8, 96, config.video_ssrc, config.scale_width, config.scale_height);
208+
#endif
205209
ftl_attach_video_component_to_stream(output->stream_config, output->video_component);
206210

207211
output->audio_component = ftl_create_audio_component(FTL_AUDIO_OPUS, 97, config.audio_ssrc);
@@ -280,8 +284,13 @@ static bool open_video_codec(struct ffmpeg_data *data)
280284
AVCodecContext *context = data->video->codec;
281285

282286
/* Hardcode in quality=realtime */
287+
#ifdef _FTL_USE_H264
283288
//char **opts = strlist_split(data->config.video_settings, ' ', false);
284289
char **opts = strlist_split("quality=realtime profile=baseline bframes=0 preset=superfast tune=zerolatency", ' ', false);
290+
#else
291+
char **opts = strlist_split("quality=realtime", ' ', false);
292+
#endif
293+
285294
int ret;
286295

287296
if (opts) {
@@ -673,9 +682,17 @@ static enum AVCodecID get_codec_id(const char *name, int id)
673682
static void set_encoder_ids(struct ffmpeg_data *data)
674683
{
675684
data->output_video->oformat->audio_codec = AV_CODEC_ID_OPUS;
685+
#ifdef _FTL_USE_H264
676686
data->output_video->oformat->video_codec = AV_CODEC_ID_H264;
687+
#else
688+
data->output_video->oformat->video_codec = AV_CODEC_ID_VP8;
689+
#endif
677690
data->output_audio->oformat->audio_codec = AV_CODEC_ID_OPUS;
691+
#ifdef _FTL_USE_H264
678692
data->output_audio->oformat->video_codec = AV_CODEC_ID_H264;
693+
#else
694+
data->output_audio->oformat->video_codec = AV_CODEC_ID_VP8;
695+
#endif
679696

680697
/* data->output_video->oformat->video_codec = get_codec_id(
681698
data->config.video_encoder,

0 commit comments

Comments
 (0)