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

Commit fa380fd

Browse files
obs-outputs: Add lost packet count from FTL to dropped_frames
1 parent f98b8a0 commit fa380fd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

UI/window-basic-main-outputs.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ void SimpleOutput::UpdateStreamingSettings_amd(obs_data_t *settings,
556556
obs_data_set_int(settings, "Usage", 0);
557557
obs_data_set_int(settings, "Profile", 100); // High
558558
obs_data_set_string(settings, "profile", "high"); // High
559-
559+
560560
// Rate Control Properties
561561
obs_data_set_int(settings, "RateControlMethod", 1);
562562
obs_data_set_string(settings, "rate_control", "CBR");
@@ -565,7 +565,7 @@ void SimpleOutput::UpdateStreamingSettings_amd(obs_data_t *settings,
565565
obs_data_set_int(settings, "FillerData", 1);
566566
obs_data_set_int(settings, "VBVBuffer", 1);
567567
obs_data_set_int(settings, "VBVBuffer.Size", bitrate);
568-
568+
569569
// Picture Control Properties
570570
obs_data_set_double(settings, "KeyframeInterval", 2.0);
571571
obs_data_set_int(settings, "keyint_sec", 2);
@@ -1381,6 +1381,9 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
13811381

13821382
const char *codec =
13831383
obs_output_get_supported_audio_codecs(streamOutput);
1384+
if (!codec) {
1385+
return false;
1386+
}
13841387

13851388
if (strcmp(codec, "aac") == 0) {
13861389
streamAudioEnc = aacTrack[trackIndex - 1];

plugins/obs-outputs/ftl-stream.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ struct ftl_stream {
9696
int64_t last_dts_usec;
9797

9898
uint64_t total_bytes_sent;
99-
int dropped_frames;
99+
uint64_t dropped_frames;
100+
uint64_t last_nack_count;
100101

101102
ftl_handle_t ftl_handle;
102103
ftl_ingest_params_t params;
@@ -948,13 +949,13 @@ static void *status_thread(void *data)
948949
} else if (status.type == FTL_STATUS_VIDEO_PACKETS) {
949950
ftl_packet_stats_msg_t *p = &status.msg.pkt_stats;
950951

951-
// Report lost frames as dropped frames
952-
stream->dropped_frames += p->recovered + p->lost;
952+
// Report nack requests as dropped frames
953+
stream->dropped_frames += p->nack_reqs - stream->last_nack_count;
954+
stream->last_nack_count = p->nack_reqs;
953955

954956
blog(LOG_INFO, "Avg packet send per second %3.1f, "
955957
"total nack requests %d",
956-
(float)p->sent * 1000.f / p->period,
957-
p->nack_reqs);
958+
(float)p->sent * 1000.f / p->period);
958959

959960
} else if (status.type == FTL_STATUS_VIDEO_PACKETS_INSTANT) {
960961
ftl_packet_stats_instant_msg_t *p =

0 commit comments

Comments
 (0)