Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion server/src/ffmpeg/builder/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const OutputFormatTypes = {
HlsDirectV2: 'hls_direct_v2',
Nut: 'nut',
Dash: 'dash',
Null: 'null',
} as const;

export const ColorRanges = {
Expand Down Expand Up @@ -195,14 +196,23 @@ export function MpegDashOutputFormat(
};
}

export const NullOutputFormat = {
type: OutputFormatTypes.Null,
} as const satisfies NullOutputFormat;

export type NullOutputFormat = {
type: typeof OutputFormatTypes.Null;
};

export type OutputFormat =
| HlsOutputFormat
| HlsDirectOutputFormat
| NutOutputFormat
| MkvOutputFormat
| MpegDashOutputFormat
| Mp4OutputFormat
| MpegTsOutputFormat;
| MpegTsOutputFormat
| NullOutputFormat;

export const OneDayMillis = 7 * 24 * 60 * 60 * 1000;
export const FiveMinutesMillis = 5 * 60 * 60 * 1000;
7 changes: 7 additions & 0 deletions server/src/ffmpeg/builder/options/NullOutputFormat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { OutputOption } from './OutputOption.ts';

export class NullOutputFormat extends OutputOption {
options(): string[] {
return ['-f', 'null'];
}
}
3 changes: 3 additions & 0 deletions server/src/ffmpeg/builder/pipeline/BasePipelineBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {
StandardFormatFlags,
ThreadCountOption,
} from '../options/GlobalOption.ts';
import { NullOutputFormat } from '../options/NullOutputFormat.ts';
import {
ClosedGopOutputOption,
DoNotMapMetadataOutputOption,
Expand Down Expand Up @@ -868,6 +869,8 @@ export abstract class BasePipelineBuilder implements PipelineBuilder {
}
case OutputFormatTypes.Dash:
throw new Error('MPEG-DASH streaming is not yet implemented');
case OutputFormatTypes.Null:
this.pipelineSteps.push(new NullOutputFormat());
}

if (
Expand Down
Loading
Loading