rebroadcast: update libav with new pipeline

This commit is contained in:
Koushik Dutta
2025-04-11 14:45:38 -07:00
parent 48f7208d55
commit 378fb41908
3 changed files with 18 additions and 18 deletions

View File

@@ -10,7 +10,7 @@
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",
"@scrypted/libav": "^1.0.196",
"@scrypted/libav": "^1.0.197",
"@scrypted/sdk": "file:../../sdk",
"h264-sps-parser": "^0.2.1",
"semver": "^7.3.7"
@@ -97,9 +97,9 @@
"link": true
},
"node_modules/@scrypted/libav": {
"version": "1.0.196",
"resolved": "https://registry.npmjs.org/@scrypted/libav/-/libav-1.0.196.tgz",
"integrity": "sha512-KZUdl39GPAD7VyDr0RWnf5t45eEAIzlWUAXlJnv68/2gi9g0m/KvhhGMM3Kyq6caqTbR5852uMwtCK98jNi6Nw==",
"version": "1.0.197",
"resolved": "https://registry.npmjs.org/@scrypted/libav/-/libav-1.0.197.tgz",
"integrity": "sha512-Iq7BFboEryAWTqGl81lHP5r050EzNPH29iqyP9/hOgLIr/2NtBZ6ldWRO/vRQco/utp7i68BGgqoV7e3keOEbQ==",
"hasInstallScript": true,
"dependencies": {
"detect-libc": "^2.0.3",
@@ -642,9 +642,9 @@
}
},
"@scrypted/libav": {
"version": "1.0.196",
"resolved": "https://registry.npmjs.org/@scrypted/libav/-/libav-1.0.196.tgz",
"integrity": "sha512-KZUdl39GPAD7VyDr0RWnf5t45eEAIzlWUAXlJnv68/2gi9g0m/KvhhGMM3Kyq6caqTbR5852uMwtCK98jNi6Nw==",
"version": "1.0.197",
"resolved": "https://registry.npmjs.org/@scrypted/libav/-/libav-1.0.197.tgz",
"integrity": "sha512-Iq7BFboEryAWTqGl81lHP5r050EzNPH29iqyP9/hOgLIr/2NtBZ6ldWRO/vRQco/utp7i68BGgqoV7e3keOEbQ==",
"requires": {
"detect-libc": "^2.0.3",
"follow-redirects": "^1.15.9",

View File

@@ -38,7 +38,7 @@
},
"dependencies": {
"@scrypted/common": "file:../../common",
"@scrypted/libav": "^1.0.196",
"@scrypted/libav": "^1.0.197",
"@scrypted/sdk": "file:../../sdk",
"h264-sps-parser": "^0.2.1",
"semver": "^7.3.7"

View File

@@ -116,7 +116,7 @@ export async function startLibavSessionWrapped(formatContext: AVFormatContext, c
try {
await startDeferred.promise;
formatContext.streams.forEach(stream => {
const pipelines = formatContext.streams.map(stream => {
if (options.audioSoftMuted && stream.type === 'audio')
return;
if (stream.type !== 'video' && stream.type !== 'audio')
@@ -145,19 +145,19 @@ export async function startLibavSessionWrapped(formatContext: AVFormatContext, c
rtp,
index,
});
});
return {
streamIndex: stream.index,
writeFormatContext: rtp,
}
}).filter(Boolean);
while (!killDeferred.finished) {
using packet = await formatContext.readFrame();
using result = await formatContext.receiveFrame(pipelines);
if (result)
resetActivityTimer();
if (killDeferred.finished)
break;
if (!packet)
continue;
const context = indexToContext.get(packet.streamIndex);
if (!context)
continue;
context.rtp.writeFrame(context.index, packet);
resetActivityTimer?.();
}
}
catch (e) {