rebroadcast: move and enable dumping of h264 extra data

This commit is contained in:
Koushik Dutta
2022-03-05 21:13:42 -08:00
parent 71ebc37216
commit d99752a9a0
3 changed files with 16 additions and 18 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.183",
"version": "0.1.184",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.183",
"version": "0.1.184",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.183",
"version": "0.1.184",
"description": "Rebroadcast and Prebuffer for VideoCameras.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -384,8 +384,19 @@ class PrebufferSession {
}
const vcodec = [
'-vcodec',
'copy',
'-vcodec', 'copy',
// Add SPS/PPS to all keyframes. Not all cameras do this!
// This isn't really necessary for a few reasons:
// MPEG-TS and MP4 will automatically do this, since there's no out of band
// way to get the SPS/PPS.
// RTSP mode may send the SPS/PPS out of band via the sdp, and then may not have
// SPS/PPS in the bit stream.
// Adding this argument isn't strictly necessary, but it normalizes the bitstream
// so consumers that expect the SPS/PPS will have it. Ran into an issue where
// the HomeKit plugin was blasting RTP packets out from RTSP mode,
// but the bitstream had no SPS/PPS information, resulting in the video never loading
// in the Home app.
'-bsf:v', 'dump_extra'
];
const rbo: ParserOptions<PrebufferParsers> = {
@@ -472,19 +483,6 @@ class PrebufferSession {
// create missing pts from dts so mpegts and mp4 muxing does not fail
const extraInputArguments = this.storage.getItem(this.ffmpegInputArgumentsKey) || DEFAULT_FFMPEG_INPUT_ARGUMENTS;
ffmpegInput.inputArguments.unshift(...extraInputArguments.split(' '));
// Add SPS/PPS to all keyframes. Not all cameras do this!
// This isn't really necessary for a few reasons:
// MPEG-TS and MP4 will automatically do this, since there's no out of band
// way to get the SPS/PPS.
// RTSP mode may send the SPS/PPS out of band via the sdp, and then may not have
// SPS/PPS in the bit stream.
// Adding this argument isn't strictly necessary, but it normalizes the bitstream
// so consumers that expect the SPS/PPS will have it. Ran into an issue where
// the HomeKit plugin was blasting RTP packets out from RTSP mode,
// but the bitstream had no SPS/PPS information, resulting in the video never loading
// in the Home app.
if (rtspMode)
ffmpegInput.inputArguments.push('-bsf:v', 'dump_extra');
session = await startParserSession(ffmpegInput, rbo);
}
}