mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
webrtc: fixup h265 keyframe hunting
This commit is contained in:
@@ -96,6 +96,8 @@ export const H265_NAL_TYPE_PPS = 34;
|
||||
export const H265_NAL_TYPE_IDR_N = 19;
|
||||
export const H265_NAL_TYPE_IDR_W = 20;
|
||||
export const H265_NAL_TYPE_FU = 49;
|
||||
export const H265_NAL_TYPE_SEI_PREFIX = 39;
|
||||
export const H265_NAL_TYPE_SEI_SUFFIX = 40;
|
||||
|
||||
export function findH264NaluType(streamChunk: StreamChunk, naluType: number) {
|
||||
if (streamChunk.type !== 'h264')
|
||||
|
||||
@@ -383,17 +383,9 @@ export function getSpsPpsVps(
|
||||
const pps = parameters['sprop-pps'];
|
||||
const vps = parameters['sprop-vps'];
|
||||
|
||||
if (!sps || !pps || !vps) {
|
||||
return {
|
||||
sps: undefined,
|
||||
pps: undefined,
|
||||
vps: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
vps: Buffer.from(vps, 'base64'),
|
||||
sps: Buffer.from(sps, 'base64'),
|
||||
pps: Buffer.from(pps, 'base64'),
|
||||
sps: sps ? Buffer.from(sps, 'base64') : undefined,
|
||||
pps: pps ? Buffer.from(pps, 'base64') : undefined,
|
||||
vps: vps ? Buffer.from(vps, 'base64') : undefined,
|
||||
}
|
||||
}
|
||||
4
plugins/webrtc/package-lock.json
generated
4
plugins/webrtc/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/webrtc",
|
||||
"version": "0.2.66",
|
||||
"version": "0.2.67",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/webrtc",
|
||||
"version": "0.2.66",
|
||||
"version": "0.2.67",
|
||||
"dependencies": {
|
||||
"@scrypted/common": "file:../../common",
|
||||
"@scrypted/sdk": "file:../../sdk",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/webrtc",
|
||||
"version": "0.2.66",
|
||||
"version": "0.2.67",
|
||||
"scripts": {
|
||||
"scrypted-setup-project": "scrypted-setup-project",
|
||||
"prescrypted-setup-project": "scrypted-package-json",
|
||||
|
||||
@@ -430,10 +430,13 @@ export class H265Repacketizer {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.codecInfo?.vps || !this.codecInfo?.sps || !this.codecInfo?.pps)
|
||||
// vps is not required.
|
||||
if (!this.codecInfo?.sps || !this.codecInfo?.pps)
|
||||
return;
|
||||
|
||||
const agg = [this.codecInfo.vps, this.codecInfo.sps, this.codecInfo.pps];
|
||||
const agg = [this.codecInfo.sps, this.codecInfo.pps];
|
||||
if (this.codecInfo.vps)
|
||||
agg.unshift(this.codecInfo.vps);
|
||||
if (this.codecInfo?.sei)
|
||||
agg.push(this.codecInfo.sei);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user