mirror of
https://github.com/koush/scrypted.git
synced 2026-03-05 02:41:59 +00:00
rebroadcast: fix mixin release. fix log spam. add a small prebuffer to remote streams.
This commit is contained in:
4
plugins/prebuffer-mixin/package-lock.json
generated
4
plugins/prebuffer-mixin/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.17",
|
||||
"version": "0.9.18",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.17",
|
||||
"version": "0.9.18",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/prebuffer-mixin",
|
||||
"version": "0.9.17",
|
||||
"version": "0.9.18",
|
||||
"description": "Video Stream Rebroadcast, Prebuffer, and Management Plugin for Scrypted.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -994,7 +994,7 @@ class PrebufferSession {
|
||||
let availablePrebuffers = parser.findSyncFrame(filtered);
|
||||
if (!availablePrebuffers) {
|
||||
this.console.warn('Unable to find sync frame in rtsp prebuffer.');
|
||||
availablePrebuffers = filtered;
|
||||
availablePrebuffers = [];
|
||||
}
|
||||
else {
|
||||
this.console.log('Found sync frame in rtsp prebuffer.');
|
||||
@@ -1018,9 +1018,11 @@ class PrebufferSession {
|
||||
const session = await this.parserSessionPromise;
|
||||
|
||||
let requestedPrebuffer = options?.prebuffer;
|
||||
if (requestedPrebuffer == null && options?.destination !== 'remote') {
|
||||
// try to gaurantee a sync frame, but don't send too much prebuffer.
|
||||
requestedPrebuffer = Math.max(4000, this.getDetectedIdrInterval() || 4000);;
|
||||
if (requestedPrebuffer == null) {
|
||||
// prebuffer search for remote streaming should be even more conservative than local network.
|
||||
const defaultPrebuffer = options?.destination === 'remote' ? 2000 : 4000;
|
||||
// try to gaurantee a sync frame, but don't search too much prebuffer to make it happen.
|
||||
requestedPrebuffer = Math.min(defaultPrebuffer, this.getDetectedIdrInterval() || defaultPrebuffer);;
|
||||
}
|
||||
|
||||
const { rtspMode, muxingMp4 } = this.getRebroadcastContainer();
|
||||
@@ -1453,6 +1455,7 @@ class PrebufferMixin extends SettingsMixinDeviceBase<VideoCamera & VideoCameraCo
|
||||
}
|
||||
|
||||
async release() {
|
||||
super.release();
|
||||
this.console.log('prebuffer session releasing if started');
|
||||
this.released = true;
|
||||
for (const session of this.sessions.values()) {
|
||||
|
||||
@@ -207,8 +207,8 @@ export async function startRtspSession(console: Console, url: string, mediaStrea
|
||||
try {
|
||||
const parsedSps = spsParse(sps);
|
||||
inputVideoResolution = getSpsResolution(parsedSps);
|
||||
console.log(inputVideoResolution);
|
||||
//console.log('parsed bitstream sps', parsedSps);
|
||||
// console.log(inputVideoResolution);
|
||||
// console.log('parsed bitstream sps', parsedSps);
|
||||
}
|
||||
catch (e) {
|
||||
console.warn('sps parsing failed');
|
||||
|
||||
Reference in New Issue
Block a user