NorskOutput.fileTs() method

Stream to a Transport Stream file.

Signature:

fileTs(settings: FileTsOutputSettings): Promise<FileTsOutputNode>;

Parameters

Parameter Type Description

settings

FileTsOutputSettings

Configuration for the Transport Stream output

Returns:

Promise<FileTsOutputNode>

Example [08_pid_normalization.ts]

Receive an RTMP stream and package it in a transport stream with explicit PID mappings

const input = await norsk.input.rtmpServer({ id: "rtmpInput" });
const videoPidNormalizer = await norsk.processor.transform.streamKeyOverride(videoStreamKeyConfig);
const audioPidNormalizer = await norsk.processor.transform.streamKeyOverride(audioStreamKeyConfig);
const output1 = await norsk.output.whep({ id: "webrtc", ...webRtcServerConfig });
const output2 = await norsk.output.fileTs(tsFileOutputSettings);

videoPidNormalizer.subscribe([{ source: input, sourceSelector: selectVideo }]);
audioPidNormalizer.subscribe([{ source: input, sourceSelector: selectAudio }]);

const normalizedSources = [{ source: videoPidNormalizer, sourceSelector: selectVideo }, { source: audioPidNormalizer, sourceSelector: selectAudio }];
output1.subscribe(normalizedSources);
output2.subscribe(normalizedSources);

console.log(`WebRTC Player URL: ${output1.playerUrl}`);

Run the following command to generate example input at url rtmp://127.0.0.1:1935/norsk/high:

ffmpeg -v error -re -stream_loop -1 -i data/InkDrop.ts  -vcodec copy -codec copy -f flv 'rtmp://127.0.0.1:1935/norsk/high'

Find Examples