Set livepeer-transcoded track to have a source track, exclude tracks with source track from stream health info
This commit is contained in:
parent
bb84a5a20c
commit
75559a367b
2 changed files with 22 additions and 10 deletions
13
lib/dtsc.cpp
13
lib/dtsc.cpp
|
@ -3233,7 +3233,6 @@ namespace DTSC{
|
||||||
JSON::Value &track = retRef[getTrackIdentifier(i)];
|
JSON::Value &track = retRef[getTrackIdentifier(i)];
|
||||||
uint64_t minKeep = getMinKeepAway(*it);
|
uint64_t minKeep = getMinKeepAway(*it);
|
||||||
track["jitter"] = minKeep;
|
track["jitter"] = minKeep;
|
||||||
if (jitter < minKeep){jitter = minKeep;}
|
|
||||||
std::string codec = getCodec(i);
|
std::string codec = getCodec(i);
|
||||||
std::string type = getType(i);
|
std::string type = getType(i);
|
||||||
track["kbits"] = getBps(i) * 8 / 1024;
|
track["kbits"] = getBps(i) * 8 / 1024;
|
||||||
|
@ -3266,7 +3265,15 @@ namespace DTSC{
|
||||||
track["keys"]["frames_max"] = longest_cnt;
|
track["keys"]["frames_max"] = longest_cnt;
|
||||||
uint64_t trBuffer = getLastms(i) - getFirstms(i);
|
uint64_t trBuffer = getLastms(i) - getFirstms(i);
|
||||||
track["buffer"] = trBuffer;
|
track["buffer"] = trBuffer;
|
||||||
if (buffer < trBuffer){buffer = trBuffer;}
|
size_t srcTrk = getSourceTrack(i);
|
||||||
|
if (srcTrk != INVALID_TRACK_ID){
|
||||||
|
if (trackValid(srcTrk)){
|
||||||
|
track["source"] = getTrackIdentifier(srcTrk);
|
||||||
|
}else{
|
||||||
|
track["source"] = "Invalid track " + JSON::Value(srcTrk).asString();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (jitter < minKeep){jitter = minKeep;}
|
||||||
if (longest_prt > 500){
|
if (longest_prt > 500){
|
||||||
issues << "unstable connection (" << longest_prt << "ms " << codec << " frame)! ";
|
issues << "unstable connection (" << longest_prt << "ms " << codec << " frame)! ";
|
||||||
}
|
}
|
||||||
|
@ -3276,6 +3283,8 @@ namespace DTSC{
|
||||||
if (longest_key > shrtest_key*1.30){
|
if (longest_key > shrtest_key*1.30){
|
||||||
issues << "unstable key interval (" << (uint32_t)(((longest_key/shrtest_key)-1)*100) << "% " << codec << " variance)! ";
|
issues << "unstable key interval (" << (uint32_t)(((longest_key/shrtest_key)-1)*100) << "% " << codec << " variance)! ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (buffer < trBuffer){buffer = trBuffer;}
|
||||||
if (codec == "AAC"){hasAAC = true;}
|
if (codec == "AAC"){hasAAC = true;}
|
||||||
if (codec == "H264"){hasH264 = true;}
|
if (codec == "H264"){hasH264 = true;}
|
||||||
if (type == "video"){
|
if (type == "video"){
|
||||||
|
|
|
@ -33,6 +33,7 @@ Util::Config conf;
|
||||||
|
|
||||||
size_t insertTurn = 0;
|
size_t insertTurn = 0;
|
||||||
bool isStuck = false;
|
bool isStuck = false;
|
||||||
|
size_t sourceIndex = INVALID_TRACK_ID;
|
||||||
|
|
||||||
namespace Mist{
|
namespace Mist{
|
||||||
|
|
||||||
|
@ -134,6 +135,7 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
if (thisTime > statSourceMs){statSourceMs = thisTime;}
|
if (thisTime > statSourceMs){statSourceMs = thisTime;}
|
||||||
if (thisPacket.getFlag("keyframe") && M.trackLoaded(thisIdx) && M.getType(thisIdx) == "video" && (thisTime - presegs[currPreSeg].time) >= 1000){
|
if (thisPacket.getFlag("keyframe") && M.trackLoaded(thisIdx) && M.getType(thisIdx) == "video" && (thisTime - presegs[currPreSeg].time) >= 1000){
|
||||||
|
sourceIndex = getMainSelectedTrack();
|
||||||
if (presegs[currPreSeg].data.size() > 187){
|
if (presegs[currPreSeg].data.size() > 187){
|
||||||
presegs[currPreSeg].keyNo = keyCount;
|
presegs[currPreSeg].keyNo = keyCount;
|
||||||
presegs[currPreSeg].width = M.getWidth(thisIdx);
|
presegs[currPreSeg].width = M.getWidth(thisIdx);
|
||||||
|
@ -233,6 +235,7 @@ namespace Mist{
|
||||||
INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID);
|
INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID);
|
||||||
S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId);
|
S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId);
|
||||||
thisIdx = M.trackIDToIndex(trackId, getpid());
|
thisIdx = M.trackIDToIndex(trackId, getpid());
|
||||||
|
meta.setSourceTrack(thisIdx, sourceIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (S.byteOffset >= S.data.size() && !S.S.hasPacket()){
|
if (S.byteOffset >= S.data.size() && !S.S.hasPacket()){
|
||||||
|
|
Loading…
Add table
Reference in a new issue