Opus in TS input/output support
This commit is contained in:
parent
1c47e9cdfc
commit
97752f2c2d
9 changed files with 240 additions and 27 deletions
|
@ -70,6 +70,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][1u].append("+MP3");
|
||||
capa["codecs"][0u][1u].append("+AC3");
|
||||
capa["codecs"][0u][1u].append("+MP2");
|
||||
capa["codecs"][0u][1u].append("+opus");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/video/mpeg";
|
||||
capa["methods"][0u]["priority"] = 1;
|
||||
|
|
|
@ -110,6 +110,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][1u].append("MP3");
|
||||
capa["codecs"][0u][1u].append("AC3");
|
||||
capa["codecs"][0u][1u].append("MP2");
|
||||
capa["codecs"][0u][1u].append("opus");
|
||||
cfg->addConnectorOptions(8888, capa);
|
||||
config = cfg;
|
||||
capa["push_urls"].append("tsudp://*");
|
||||
|
|
|
@ -164,11 +164,21 @@ namespace Mist{
|
|||
packTime = aacSamples * 90000 / freq;
|
||||
}
|
||||
}
|
||||
bs = TS::Packet::getPESAudioLeadIn(tempLen, packTime, M.getBps(thisIdx));
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
if (codec == "AAC"){
|
||||
bs = TS::getAudioHeader(dataLen, M.getInit(thisIdx));
|
||||
if (codec == "opus"){
|
||||
tempLen += 3 + (dataLen/255);
|
||||
bs = TS::Packet::getPESPS1LeadIn(tempLen, packTime, M.getBps(thisIdx));
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
bs = "\177\340";
|
||||
bs.append(dataLen/255, (char)255);
|
||||
bs.append(1, (char)(dataLen-255*(dataLen/255)));
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
}else{
|
||||
bs = TS::Packet::getPESAudioLeadIn(tempLen, packTime, M.getBps(thisIdx));
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
if (codec == "AAC"){
|
||||
bs = TS::getAudioHeader(dataLen, M.getInit(thisIdx));
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
}
|
||||
}
|
||||
fillPacket(dataPointer, dataLen, firstPack, video, keyframe, pkgPid, contPkg);
|
||||
}else if (type == "meta"){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue