Skip to content

Commit

Permalink
Use a preferred video encoder for HKSV if configured to do so.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Feb 12, 2022
1 parent b5e1702 commit 7655d42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/protect-ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class FfmpegProcess {
protected readonly name: () => string;
protected readonly nvr: ProtectNvr;
protected process: ExecaChildProcess | null;
private protectCamera: ProtectCamera;
protected protectCamera: ProtectCamera;

// Create a new FFmpeg process instance.
constructor(protectCamera: ProtectCamera, commandLineArgs?: string[], callback?: StreamRequestCallback) {
Expand Down Expand Up @@ -416,7 +416,7 @@ export class FfmpegRecordingProcess extends FfmpegProcess {
"-f", "mp4",
"-i", "pipe:0",
"-map", "0:v",
"-vcodec", "libx264",
"-vcodec", this.protectCamera.stream.videoEncoder || "libx264",
"-pix_fmt", "yuvj420p",
"-profile:v", requestedProfile,
"-level:v", requestedLevel,
Expand Down
2 changes: 1 addition & 1 deletion src/protect-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class ProtectStreamingDelegate implements CameraStreamingDelegate {
private rtspEntry: RtspEntry | null;
private snapshotCache: { [index: string]: { image: Buffer, time: number } };
private verboseFfmpegTimer!: NodeJS.Timeout | null;
private videoEncoder!: string;
public readonly videoEncoder!: string;
public readonly videoProcessor: string;

constructor(protectCamera: ProtectCamera, resolutions: [number, number, number][]) {
Expand Down

0 comments on commit 7655d42

Please sign in to comment.