@streamfarm/sdk 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Версии — по [SemVer](https://semver.org/lang/ru/), свои у библиотеки, не связаны с версиями StreamFarm.
4
4
 
5
+ ## 1.3.0 — 2026-12-04
6
+
7
+ - У трансляции поле `input`: что передаёт энкодер во время эфира — кодек, размер и частота кадров, битрейт видео,
8
+ интервал ключевых кадров (`input.video.keyframeIntervalSec`), кодек и битрейт звука; `null` — эфира нет или
9
+ сервер ещё не прислал отчёт. Трансляция без перекодирования уходит на площадки как есть, так по нему можно
10
+ проверить настройки энкодера: H.264 и AAC, ключевой кадр раз в 2 с. Типы `StreamInput`, `StreamInputVideo`,
11
+ `StreamInputAudio`.
12
+
5
13
  ## 1.2.0 — 2026-12-03
6
14
 
7
15
  - У подключения соцсети поле `tokenExpiredSince`: с этого времени соцсеть не продлевает токен доступа (её сервер
@@ -963,6 +963,31 @@ export interface components {
963
963
  /** @description Скорость обработки относительно реального времени (1 — успевает). */
964
964
  speed: number;
965
965
  };
966
+ /** @description Что передаёт энкодер, по отчёту сервера во время эфира. Трансляция без перекодирования уходит на площадки и в плеер как есть, так по этим полям можно проверить настройки энкодера: H.264 и AAC, ключевой кадр раз в 2 с, до 1080p и 60 к/с. `null` — энкодер выключен или сервер ещё не прислал отчёт (первые секунды эфира). */
967
+ input: {
968
+ /** @description Видео; `null` — энкодер не передаёт видео. */
969
+ video: {
970
+ /** @description Кодек: `h264` — площадки принимают только его; `hevc`, `av1`, `vp9`… уходят на площадки только с перекодированием. */
971
+ codec: string;
972
+ /** @description Ширина кадра, пикселей. */
973
+ width: number;
974
+ /** @description Высота кадра, пикселей. */
975
+ height: number;
976
+ /** @description Кадров в секунду. */
977
+ fps: number;
978
+ /** @description Битрейт видео, кбит/с. */
979
+ bitrateKbps: number;
980
+ /** @description Сколько секунд между ключевыми кадрами: оценка по счётчикам кадров с начала эфира, точность — полинтервала. Площадки ждут ключевой кадр раз в 2 с; у трансляции без перекодирования (`transcoding: false`) при интервале больше 2,5 с эфир на площадке может запускаться с ошибкой, зрители дольше ждут картинку, а после сбоя она дольше стоит. В OBS — «Интервал ключевых кадров» 2 (у «авто» — 250 кадров, 8 с при 30 к/с). Перекодированный поток получает свой ключевой кадр раз в 2 с, эфир из браузера — тоже. `null` — первые секунды эфира. */
981
+ keyframeIntervalSec: number | null;
982
+ } | null;
983
+ /** @description Звук; `null` — звук не приходит: энкодер его не передаёт или передаёт по RTMP в кодеке, который сервер отбрасывает (MP3, Opus). */
984
+ audio: {
985
+ /** @description Кодек: `aac` — площадки и плеер принимают только его. */
986
+ codec: string;
987
+ /** @description Битрейт звука, кбит/с. */
988
+ bitrateKbps: number;
989
+ } | null;
990
+ } | null;
966
991
  /** @description Страница плеера StreamFarm. */
967
992
  playerUrl: string;
968
993
  /** @description Плеер без страницы вокруг: видео на весь фрейм, для `<iframe>` на вашем сайте. В эфире и на заставке ведёт себя так же, как страница плеера. */
@@ -1948,6 +1973,20 @@ export interface operations {
1948
1973
  * "totalViewers": 51,
1949
1974
  * "speed": 1
1950
1975
  * },
1976
+ * "input": {
1977
+ * "video": {
1978
+ * "codec": "h264",
1979
+ * "width": 1280,
1980
+ * "height": 720,
1981
+ * "fps": 30,
1982
+ * "bitrateKbps": 2852.5,
1983
+ * "keyframeIntervalSec": 2
1984
+ * },
1985
+ * "audio": {
1986
+ * "codec": "aac",
1987
+ * "bitrateKbps": 160
1988
+ * }
1989
+ * },
1951
1990
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
1952
1991
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
1953
1992
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2066,6 +2105,7 @@ export interface operations {
2066
2105
  * "totalViewers": 0,
2067
2106
  * "speed": 0
2068
2107
  * },
2108
+ * "input": null,
2069
2109
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2070
2110
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2071
2111
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2148,6 +2188,20 @@ export interface operations {
2148
2188
  * "totalViewers": 51,
2149
2189
  * "speed": 1
2150
2190
  * },
2191
+ * "input": {
2192
+ * "video": {
2193
+ * "codec": "h264",
2194
+ * "width": 1280,
2195
+ * "height": 720,
2196
+ * "fps": 30,
2197
+ * "bitrateKbps": 2852.5,
2198
+ * "keyframeIntervalSec": 2
2199
+ * },
2200
+ * "audio": {
2201
+ * "codec": "aac",
2202
+ * "bitrateKbps": 160
2203
+ * }
2204
+ * },
2151
2205
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2152
2206
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2153
2207
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2281,6 +2335,20 @@ export interface operations {
2281
2335
  * "totalViewers": 51,
2282
2336
  * "speed": 1
2283
2337
  * },
2338
+ * "input": {
2339
+ * "video": {
2340
+ * "codec": "h264",
2341
+ * "width": 1280,
2342
+ * "height": 720,
2343
+ * "fps": 30,
2344
+ * "bitrateKbps": 2852.5,
2345
+ * "keyframeIntervalSec": 2
2346
+ * },
2347
+ * "audio": {
2348
+ * "codec": "aac",
2349
+ * "bitrateKbps": 160
2350
+ * }
2351
+ * },
2284
2352
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2285
2353
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2286
2354
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2363,6 +2431,20 @@ export interface operations {
2363
2431
  * "totalViewers": 51,
2364
2432
  * "speed": 1
2365
2433
  * },
2434
+ * "input": {
2435
+ * "video": {
2436
+ * "codec": "h264",
2437
+ * "width": 1280,
2438
+ * "height": 720,
2439
+ * "fps": 30,
2440
+ * "bitrateKbps": 2852.5,
2441
+ * "keyframeIntervalSec": 2
2442
+ * },
2443
+ * "audio": {
2444
+ * "codec": "aac",
2445
+ * "bitrateKbps": 160
2446
+ * }
2447
+ * },
2366
2448
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2367
2449
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2368
2450
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -16,6 +16,10 @@ export type Connection = Schemas['Connection'];
16
16
  export type Stream = Schemas['Stream'];
17
17
  export type StreamSession = Stream['session'];
18
18
  export type StreamStats = Stream['stats'];
19
+ /** What the encoder publishes while live: codecs, frame size and rate, bitrates, the keyframe interval. */
20
+ export type StreamInput = NonNullable<Stream['input']>;
21
+ export type StreamInputVideo = NonNullable<StreamInput['video']>;
22
+ export type StreamInputAudio = NonNullable<StreamInput['audio']>;
19
23
  /** What an encoder publishes with: RTMP, and WHIP where the region takes it. */
20
24
  export type Credentials = Schemas['Credentials'];
21
25
  export type Platform = Schemas['Platform'];
@@ -1,2 +1,2 @@
1
1
  /** The SDK's version: sent in the User-Agent. test/resources.test.ts keeps it equal to package.json's. */
2
- export declare const VERSION = "1.2.0";
2
+ export declare const VERSION = "1.3.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** The SDK's version: sent in the User-Agent. test/resources.test.ts keeps it equal to package.json's. */
5
- exports.VERSION = '1.2.0';
5
+ exports.VERSION = '1.3.0';
@@ -963,6 +963,31 @@ export interface components {
963
963
  /** @description Скорость обработки относительно реального времени (1 — успевает). */
964
964
  speed: number;
965
965
  };
966
+ /** @description Что передаёт энкодер, по отчёту сервера во время эфира. Трансляция без перекодирования уходит на площадки и в плеер как есть, так по этим полям можно проверить настройки энкодера: H.264 и AAC, ключевой кадр раз в 2 с, до 1080p и 60 к/с. `null` — энкодер выключен или сервер ещё не прислал отчёт (первые секунды эфира). */
967
+ input: {
968
+ /** @description Видео; `null` — энкодер не передаёт видео. */
969
+ video: {
970
+ /** @description Кодек: `h264` — площадки принимают только его; `hevc`, `av1`, `vp9`… уходят на площадки только с перекодированием. */
971
+ codec: string;
972
+ /** @description Ширина кадра, пикселей. */
973
+ width: number;
974
+ /** @description Высота кадра, пикселей. */
975
+ height: number;
976
+ /** @description Кадров в секунду. */
977
+ fps: number;
978
+ /** @description Битрейт видео, кбит/с. */
979
+ bitrateKbps: number;
980
+ /** @description Сколько секунд между ключевыми кадрами: оценка по счётчикам кадров с начала эфира, точность — полинтервала. Площадки ждут ключевой кадр раз в 2 с; у трансляции без перекодирования (`transcoding: false`) при интервале больше 2,5 с эфир на площадке может запускаться с ошибкой, зрители дольше ждут картинку, а после сбоя она дольше стоит. В OBS — «Интервал ключевых кадров» 2 (у «авто» — 250 кадров, 8 с при 30 к/с). Перекодированный поток получает свой ключевой кадр раз в 2 с, эфир из браузера — тоже. `null` — первые секунды эфира. */
981
+ keyframeIntervalSec: number | null;
982
+ } | null;
983
+ /** @description Звук; `null` — звук не приходит: энкодер его не передаёт или передаёт по RTMP в кодеке, который сервер отбрасывает (MP3, Opus). */
984
+ audio: {
985
+ /** @description Кодек: `aac` — площадки и плеер принимают только его. */
986
+ codec: string;
987
+ /** @description Битрейт звука, кбит/с. */
988
+ bitrateKbps: number;
989
+ } | null;
990
+ } | null;
966
991
  /** @description Страница плеера StreamFarm. */
967
992
  playerUrl: string;
968
993
  /** @description Плеер без страницы вокруг: видео на весь фрейм, для `<iframe>` на вашем сайте. В эфире и на заставке ведёт себя так же, как страница плеера. */
@@ -1948,6 +1973,20 @@ export interface operations {
1948
1973
  * "totalViewers": 51,
1949
1974
  * "speed": 1
1950
1975
  * },
1976
+ * "input": {
1977
+ * "video": {
1978
+ * "codec": "h264",
1979
+ * "width": 1280,
1980
+ * "height": 720,
1981
+ * "fps": 30,
1982
+ * "bitrateKbps": 2852.5,
1983
+ * "keyframeIntervalSec": 2
1984
+ * },
1985
+ * "audio": {
1986
+ * "codec": "aac",
1987
+ * "bitrateKbps": 160
1988
+ * }
1989
+ * },
1951
1990
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
1952
1991
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
1953
1992
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2066,6 +2105,7 @@ export interface operations {
2066
2105
  * "totalViewers": 0,
2067
2106
  * "speed": 0
2068
2107
  * },
2108
+ * "input": null,
2069
2109
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2070
2110
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2071
2111
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2148,6 +2188,20 @@ export interface operations {
2148
2188
  * "totalViewers": 51,
2149
2189
  * "speed": 1
2150
2190
  * },
2191
+ * "input": {
2192
+ * "video": {
2193
+ * "codec": "h264",
2194
+ * "width": 1280,
2195
+ * "height": 720,
2196
+ * "fps": 30,
2197
+ * "bitrateKbps": 2852.5,
2198
+ * "keyframeIntervalSec": 2
2199
+ * },
2200
+ * "audio": {
2201
+ * "codec": "aac",
2202
+ * "bitrateKbps": 160
2203
+ * }
2204
+ * },
2151
2205
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2152
2206
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2153
2207
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2281,6 +2335,20 @@ export interface operations {
2281
2335
  * "totalViewers": 51,
2282
2336
  * "speed": 1
2283
2337
  * },
2338
+ * "input": {
2339
+ * "video": {
2340
+ * "codec": "h264",
2341
+ * "width": 1280,
2342
+ * "height": 720,
2343
+ * "fps": 30,
2344
+ * "bitrateKbps": 2852.5,
2345
+ * "keyframeIntervalSec": 2
2346
+ * },
2347
+ * "audio": {
2348
+ * "codec": "aac",
2349
+ * "bitrateKbps": 160
2350
+ * }
2351
+ * },
2284
2352
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2285
2353
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2286
2354
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -2363,6 +2431,20 @@ export interface operations {
2363
2431
  * "totalViewers": 51,
2364
2432
  * "speed": 1
2365
2433
  * },
2434
+ * "input": {
2435
+ * "video": {
2436
+ * "codec": "h264",
2437
+ * "width": 1280,
2438
+ * "height": 720,
2439
+ * "fps": 30,
2440
+ * "bitrateKbps": 2852.5,
2441
+ * "keyframeIntervalSec": 2
2442
+ * },
2443
+ * "audio": {
2444
+ * "codec": "aac",
2445
+ * "bitrateKbps": 160
2446
+ * }
2447
+ * },
2366
2448
  * "playerUrl": "https://player.streamfarm.ru/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2367
2449
  * "embedUrl": "https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21",
2368
2450
  * "embedCode": "<iframe src=\"https://player.streamfarm.ru/embed/3f6c1e1a-8a3b-4f43-9a52-0c0b6a5e7d21\" width=\"640\" height=\"360\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen frameborder=\"0\"></iframe>",
@@ -16,6 +16,10 @@ export type Connection = Schemas['Connection'];
16
16
  export type Stream = Schemas['Stream'];
17
17
  export type StreamSession = Stream['session'];
18
18
  export type StreamStats = Stream['stats'];
19
+ /** What the encoder publishes while live: codecs, frame size and rate, bitrates, the keyframe interval. */
20
+ export type StreamInput = NonNullable<Stream['input']>;
21
+ export type StreamInputVideo = NonNullable<StreamInput['video']>;
22
+ export type StreamInputAudio = NonNullable<StreamInput['audio']>;
19
23
  /** What an encoder publishes with: RTMP, and WHIP where the region takes it. */
20
24
  export type Credentials = Schemas['Credentials'];
21
25
  export type Platform = Schemas['Platform'];
@@ -1,2 +1,2 @@
1
1
  /** The SDK's version: sent in the User-Agent. test/resources.test.ts keeps it equal to package.json's. */
2
- export declare const VERSION = "1.2.0";
2
+ export declare const VERSION = "1.3.0";
@@ -1,2 +1,2 @@
1
1
  /** The SDK's version: sent in the User-Agent. test/resources.test.ts keeps it equal to package.json's. */
2
- export const VERSION = '1.2.0';
2
+ export const VERSION = '1.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamfarm/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Библиотека для публичного API StreamFarm: трансляции, площадки, реклама, чат и студия из Node.js",
5
5
  "license": "MIT",
6
6
  "author": "StreamFarm",