Merge branch 'development' into LTS_development
# Conflicts: # src/controller/controller_statistics.cpp # src/input/input_buffer.cpp # src/input/input_dtsc.cpp # src/input/input_ebml.cpp # src/input/input_flv.cpp # src/input/input_mp3.cpp # src/output/output_httpts.cpp # src/output/output_progressive_mp3.cpp # src/output/output_progressive_mp4.cpp
This commit is contained in:
commit
9e1539a2b9
32 changed files with 95 additions and 111 deletions
|
@ -38,16 +38,16 @@ namespace Mist {
|
|||
option["long"] = "json";
|
||||
option["short"] = "j";
|
||||
option["help"] = "Output MistIn info in JSON format, then exit";
|
||||
option["value"].append(0ll);
|
||||
option["value"].append(0);
|
||||
config->addOption("json", option);
|
||||
option.null();
|
||||
option["arg_num"] = 1ll;
|
||||
option["arg_num"] = 1;
|
||||
option["arg"] = "string";
|
||||
option["help"] = "Name of the input file or - for stdin";
|
||||
option["value"].append("-");
|
||||
config->addOption("input", option);
|
||||
option.null();
|
||||
option["arg_num"] = 2ll;
|
||||
option["arg_num"] = 2;
|
||||
option["arg"] = "string";
|
||||
option["help"] = "Name of the output file or - for stdout";
|
||||
option["value"].append("-");
|
||||
|
|
|
@ -32,33 +32,33 @@ namespace Mist {
|
|||
option["long"] = "buffer";
|
||||
option["short"] = "b";
|
||||
option["help"] = "DVR buffer time in ms";
|
||||
option["value"].append(50000LL);
|
||||
option["value"].append(50000);
|
||||
config->addOption("bufferTime", option);
|
||||
capa["optional"]["DVR"]["name"] = "Buffer time (ms)";
|
||||
capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback.";
|
||||
capa["optional"]["DVR"]["option"] = "--buffer";
|
||||
capa["optional"]["DVR"]["type"] = "uint";
|
||||
capa["optional"]["DVR"]["default"] = 50000LL;
|
||||
capa["optional"]["DVR"]["default"] = 50000;
|
||||
/*LTS-start*/
|
||||
option.null();
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "cut";
|
||||
option["short"] = "c";
|
||||
option["help"] = "Any timestamps before this will be cut from the live buffer";
|
||||
option["value"].append(0LL);
|
||||
option["value"].append(0);
|
||||
config->addOption("cut", option);
|
||||
capa["optional"]["cut"]["name"] = "Cut time (ms)";
|
||||
capa["optional"]["cut"]["help"] = "Any timestamps before this will be cut from the live buffer.";
|
||||
capa["optional"]["cut"]["option"] = "--cut";
|
||||
capa["optional"]["cut"]["type"] = "uint";
|
||||
capa["optional"]["cut"]["default"] = 0LL;
|
||||
capa["optional"]["cut"]["default"] = 0;
|
||||
option.null();
|
||||
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "resume";
|
||||
option["short"] = "R";
|
||||
option["help"] = "Enable resuming support (1) or disable resuming support (0, default)";
|
||||
option["value"].append(0LL);
|
||||
option["value"].append(0);
|
||||
config->addOption("resume", option);
|
||||
capa["optional"]["resume"]["name"] = "Resume support";
|
||||
capa["optional"]["resume"]["help"] = "If enabled, the buffer will linger after source disconnect to allow resuming the stream later. If disabled, the buffer will instantly close on source disconnect.";
|
||||
|
@ -68,26 +68,26 @@ namespace Mist {
|
|||
capa["optional"]["resume"]["select"][0u][1u] = "Disabled";
|
||||
capa["optional"]["resume"]["select"][1u][0u] = "1";
|
||||
capa["optional"]["resume"]["select"][1u][1u] = "Enabled";
|
||||
capa["optional"]["resume"]["default"] = 0LL;
|
||||
capa["optional"]["resume"]["default"] = 0;
|
||||
option.null();
|
||||
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "segment-size";
|
||||
option["short"] = "S";
|
||||
option["help"] = "Target time duration in milliseconds for segments";
|
||||
option["value"].append(5000LL);
|
||||
option["value"].append(5000);
|
||||
config->addOption("segmentsize", option);
|
||||
capa["optional"]["segmentsize"]["name"] = "Segment size (ms)";
|
||||
capa["optional"]["segmentsize"]["help"] = "Target time duration in milliseconds for segments.";
|
||||
capa["optional"]["segmentsize"]["option"] = "--segment-size";
|
||||
capa["optional"]["segmentsize"]["type"] = "uint";
|
||||
capa["optional"]["segmentsize"]["default"] = 5000LL;
|
||||
capa["optional"]["segmentsize"]["default"] = 5000;
|
||||
option.null();
|
||||
/*LTS-end*/
|
||||
|
||||
capa["source_match"] = "push://*";
|
||||
capa["non-provider"] = true;//Indicates we don't provide data, only collect it
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["desc"] = "This input type is both used for push- and pull-based streams. It provides a buffer for live media data. The push://[host][@password] style source allows all enabled protocols that support push input to accept a push into MistServer, where you can accept incoming streams from everyone, based on a set password, and/or use hostname/IP whitelisting.";
|
||||
capa["codecs"][0u][0u].append("*");
|
||||
capa["codecs"][0u][1u].append("*");
|
||||
|
@ -344,7 +344,7 @@ namespace Mist {
|
|||
nProxy.metaPages[0].master = false;
|
||||
}
|
||||
myMeta.writeTo(nProxy.metaPages[0].mapped);
|
||||
memset(nProxy.metaPages[0].mapped + myMeta.getSendLen(), 0, (nProxy.metaPages[0].len > myMeta.getSendLen() ? std::min(nProxy.metaPages[0].len - myMeta.getSendLen(), 4ll) : 0));
|
||||
memset(nProxy.metaPages[0].mapped + myMeta.getSendLen(), 0, (nProxy.metaPages[0].len > myMeta.getSendLen() ? std::min((size_t)(nProxy.metaPages[0].len - myMeta.getSendLen()), (size_t)4) : 0));
|
||||
liveMeta->post();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Mist {
|
|||
inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) {
|
||||
capa["name"] = "DTSC";
|
||||
capa["desc"] = "Load DTSC files as Video on Demand sources, or dtsc:// URLs from other MistServer instances for live sources. This is the optimal method to pull live sources from other MistServer (or compatible) instances.";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["source_match"].append("/*.dtsc");
|
||||
capa["source_match"].append("dtsc://*");
|
||||
capa["source_file"] = "$source";
|
||||
|
@ -34,26 +34,26 @@ namespace Mist {
|
|||
option["long"] = "buffer";
|
||||
option["short"] = "b";
|
||||
option["help"] = "Live stream DVR buffer time in ms";
|
||||
option["value"].append(50000LL);
|
||||
option["value"].append(50000);
|
||||
config->addOption("bufferTime", option);
|
||||
capa["optional"]["DVR"]["name"] = "Buffer time (ms)";
|
||||
capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback.";
|
||||
capa["optional"]["DVR"]["option"] = "--buffer";
|
||||
capa["optional"]["DVR"]["type"] = "uint";
|
||||
capa["optional"]["DVR"]["default"] = 50000LL;
|
||||
capa["optional"]["DVR"]["default"] = 50000;
|
||||
/*LTS-START*/
|
||||
option.null();
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "segment-size";
|
||||
option["short"] = "S";
|
||||
option["help"] = "Target time duration in milliseconds for segments";
|
||||
option["value"].append(5000LL);
|
||||
option["value"].append(5000);
|
||||
config->addOption("segmentsize", option);
|
||||
capa["optional"]["segmentsize"]["name"] = "Segment size (ms)";
|
||||
capa["optional"]["segmentsize"]["help"] = "Target time duration in milliseconds for segments.";
|
||||
capa["optional"]["segmentsize"]["option"] = "--segment-size";
|
||||
capa["optional"]["segmentsize"]["type"] = "uint";
|
||||
capa["optional"]["segmentsize"]["default"] = 5000LL;
|
||||
capa["optional"]["segmentsize"]["default"] = 5000;
|
||||
/*LTS-END*/
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Mist{
|
|||
capa["source_match"].append("/*.mks");
|
||||
capa["source_match"].append("/*.webm");
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"].append("H264");
|
||||
capa["codecs"].append("HEVC");
|
||||
capa["codecs"].append("VP8");
|
||||
|
@ -342,7 +342,7 @@ namespace Mist{
|
|||
}
|
||||
if (E.getID() == EBML::EID_TIMECODESCALE){
|
||||
uint64_t timeScaleVal = E.getValUInt();
|
||||
myMeta.inputLocalVars["timescale"] = (long long)timeScaleVal;
|
||||
myMeta.inputLocalVars["timescale"] = timeScaleVal;
|
||||
timeScale = ((double)timeScaleVal) / 1000000.0;
|
||||
}
|
||||
//Live streams stop parsing the header as soon as the first Cluster is encountered
|
||||
|
@ -414,7 +414,7 @@ namespace Mist{
|
|||
}
|
||||
}
|
||||
|
||||
myMeta.inputLocalVars["maxframeoffset"] = (long long)maxEBMLFrameOffset;
|
||||
myMeta.inputLocalVars["maxframeoffset"] = maxEBMLFrameOffset;
|
||||
|
||||
bench = Util::getMicros(bench);
|
||||
INFO_MSG("Header generated in %llu ms", bench / 1000);
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Mist {
|
|||
capa["desc"] = "Allows loading FLV files for Video on Demand.";
|
||||
capa["source_match"] = "/*.flv";
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("H263");
|
||||
capa["codecs"][0u][0u].append("VP6");
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Mist{
|
|||
capa["source_match"] = "h264-exec:*";
|
||||
//May be set to always-on mode
|
||||
capa["always_match"].append("h264-exec:*");
|
||||
capa["priority"] = 0ll;
|
||||
capa["priority"] = 0;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
frameCount = 0;
|
||||
startTime = Util::bootMS();
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Mist {
|
|||
capa["desc"] = "This input allows you to stream MP3 Video on Demand files.";
|
||||
capa["source_match"] = "/*.mp3";
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("MP3");
|
||||
timestamp = 0;
|
||||
}
|
||||
|
@ -153,9 +153,9 @@ namespace Mist {
|
|||
static JSON::Value thisPack;
|
||||
thisPack.null();
|
||||
thisPack["trackid"] = 1;
|
||||
thisPack["bpos"] = (long long)filePos;
|
||||
thisPack["bpos"] = (uint64_t)filePos;
|
||||
thisPack["data"] = std::string(packHeader, dataSize);
|
||||
thisPack["time"] = (long long)timestamp;
|
||||
thisPack["time"] = timestamp;
|
||||
//Write the json value to lastpack
|
||||
std::string tmpStr = thisPack.toNetPacked();
|
||||
thisPacket.reInit(tmpStr.data(), tmpStr.size());
|
||||
|
|
|
@ -18,20 +18,20 @@ namespace Mist {
|
|||
|
||||
JSON::Value segment::toJSON(OGG::oggCodec myCodec){
|
||||
JSON::Value retval;
|
||||
retval["time"] = (long long int)time;
|
||||
retval["trackid"] = (long long int)tid;
|
||||
retval["time"] = time;
|
||||
retval["trackid"] = tid;
|
||||
std::string tmpString = "";
|
||||
for (unsigned int i = 0; i < parts.size(); i++){
|
||||
tmpString += parts[i];
|
||||
}
|
||||
retval["data"] = tmpString;
|
||||
// INFO_MSG("Setting bpos for packet on track %llu, time %llu, to %llu", tid, time, bytepos);
|
||||
retval["bpos"] = (long long int)bytepos;
|
||||
retval["bpos"] = bytepos;
|
||||
if (myCodec == OGG::THEORA){
|
||||
if (!theora::isHeader(tmpString.data(), tmpString.size())){
|
||||
theora::header tmpHeader((char*)tmpString.data(), tmpString.size());
|
||||
if (tmpHeader.getFTYPE() == 0){
|
||||
retval["keyframe"] = 1LL;
|
||||
retval["keyframe"] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
INFO_MSG("Found %dms for track %lu at %llu bytepos %llu", seekTime, *it, tmpPos.time, tmpPos.bytepos);
|
||||
int backChrs=std::min(280ull, tmpPos.bytepos - 1);
|
||||
int backChrs=std::min((uint64_t)280, tmpPos.bytepos - 1);
|
||||
fseek(inFile, tmpPos.bytepos - backChrs, SEEK_SET);
|
||||
char buffer[300];
|
||||
fread(buffer, 300, 1, inFile);
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace Mist {
|
|||
return time < rhs.time || (time == rhs.time && tid < rhs.tid);
|
||||
}
|
||||
std::vector<std::string> parts;
|
||||
unsigned long long int time;
|
||||
unsigned long long int tid;
|
||||
long long unsigned int bytepos;
|
||||
uint64_t time;
|
||||
uint64_t tid;
|
||||
uint64_t bytepos;
|
||||
bool keyframe;
|
||||
JSON::Value toJSON(OGG::oggCodec myCodec);
|
||||
};
|
||||
|
@ -36,10 +36,10 @@ namespace Mist {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
long unsigned int trackID;
|
||||
long long unsigned int time;
|
||||
long long unsigned int bytepos;
|
||||
long long unsigned int segmentNo;
|
||||
uint64_t trackID;
|
||||
uint64_t time;
|
||||
uint64_t bytepos;
|
||||
uint64_t segmentNo;
|
||||
};
|
||||
/*
|
||||
class oggTrack {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue