From 75cefe99561d1aaafc6e390529c8035ba043d25b Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 22 Mar 2018 10:41:52 +0100 Subject: [PATCH] Added buffer and rate params to RTSP output --- src/output/output_rtsp.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/output/output_rtsp.cpp b/src/output/output_rtsp.cpp index 56f85c7d..26f43da2 100644 --- a/src/output/output_rtsp.cpp +++ b/src/output/output_rtsp.cpp @@ -177,6 +177,30 @@ namespace Mist{ streamName); } + //allow setting of max lead time through buffer variable. + //max lead time is set in MS, but the variable is in integer seconds for simplicity. + if (HTTP_R.GetVar("buffer") != ""){ + maxSkipAhead = JSON::Value(HTTP_R.GetVar("buffer")).asInt() * 1000; + } + //allow setting of play back rate through buffer variable. + //play back rate is set in MS per second, but the variable is a simple multiplier. + if (HTTP_R.GetVar("rate") != ""){ + double multiplier = atof(HTTP_R.GetVar("rate").c_str()); + if (multiplier){ + realTime = 1000 / multiplier; + }else{ + realTime = 0; + } + } + if (HTTP_R.GetHeader("X-Mist-Rate") != ""){ + double multiplier = atof(HTTP_R.GetHeader("X-Mist-Rate").c_str()); + if (multiplier){ + realTime = 1000 / multiplier; + }else{ + realTime = 0; + } + } + // set the date time_t timer; time(&timer);