node-av 6.0.0-beta.9 → 6.0.1-beta.1

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.
Files changed (51) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +5 -68
  3. package/dist/api/bitstream-filter.js +0 -2
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +169 -9
  6. package/dist/api/decoder.js +351 -43
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +64 -0
  9. package/dist/api/encoder.js +147 -84
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter.js +0 -2
  12. package/dist/api/filter.js.map +1 -1
  13. package/dist/api/muxer.d.ts +19 -0
  14. package/dist/api/muxer.js +44 -24
  15. package/dist/api/muxer.js.map +1 -1
  16. package/dist/api/rtp-stream.d.ts +14 -11
  17. package/dist/api/rtp-stream.js +22 -47
  18. package/dist/api/rtp-stream.js.map +1 -1
  19. package/dist/api/scaler.js.map +1 -1
  20. package/dist/api/utilities/async-queue.js +0 -2
  21. package/dist/api/utilities/async-queue.js.map +1 -1
  22. package/dist/api/utilities/codec-format.d.ts +87 -0
  23. package/dist/api/utilities/codec-format.js +117 -0
  24. package/dist/api/utilities/codec-format.js.map +1 -0
  25. package/dist/api/utilities/index.d.ts +1 -0
  26. package/dist/api/utilities/index.js +2 -0
  27. package/dist/api/utilities/index.js.map +1 -1
  28. package/dist/api/utilities/whisper-model.d.ts +20 -0
  29. package/dist/api/utilities/whisper-model.js +61 -2
  30. package/dist/api/utilities/whisper-model.js.map +1 -1
  31. package/dist/constants/bsf-options.d.ts +8 -1
  32. package/dist/constants/constants.d.ts +2 -0
  33. package/dist/constants/constants.js +2 -0
  34. package/dist/constants/constants.js.map +1 -1
  35. package/dist/constants/format-options.d.ts +4 -0
  36. package/dist/ffmpeg/install.js +3 -0
  37. package/dist/ffmpeg/install.js.map +1 -1
  38. package/dist/lib/binding.d.ts +2 -0
  39. package/dist/lib/binding.js +6 -2
  40. package/dist/lib/binding.js.map +1 -1
  41. package/dist/lib/frame.d.ts +8 -0
  42. package/dist/lib/frame.js +10 -0
  43. package/dist/lib/frame.js.map +1 -1
  44. package/dist/lib/native-types.d.ts +12 -0
  45. package/dist/lib/packet.d.ts +8 -0
  46. package/dist/lib/packet.js +10 -0
  47. package/dist/lib/packet.js.map +1 -1
  48. package/dist/lib/utilities.d.ts +45 -0
  49. package/dist/lib/utilities.js +49 -0
  50. package/dist/lib/utilities.js.map +1 -1
  51. package/package.json +21 -21
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-2025 seydx <dev@seydx.com>
3
+ Copyright (c) 2023-2026 seydx <hi@seydx.dev>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -6,9 +6,10 @@
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/node-av.svg)](https://www.npmjs.com/package/node-av)
8
8
  [![npm downloads](https://img.shields.io/npm/dt/node-av.svg)](https://www.npmjs.com/package/node-av)
9
+ [![Socket Badge](https://badge.socket.dev/npm/package/node-av/6.0.0)](https://socket.dev/npm/package/node-av)
9
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
11
  [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
11
- [![FFmpeg](https://img.shields.io/badge/FFmpeg-8.1-green.svg)](https://ffmpeg.org)
12
+ [![FFmpeg](https://img.shields.io/badge/FFmpeg-8.1.1-green.svg)](https://ffmpeg.org)
12
13
  [![Platform](https://img.shields.io/badge/platform-Windows%20(MSVC%20%7C%20MinGW)%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/seydx/node-av)
13
14
 
14
15
  Native Node.js bindings for FFmpeg with full TypeScript support - including type-safe options (autocomplete + validation) for every codec, format, filter, and bitstream filter, generated from FFmpeg's own metadata. Provides direct access to FFmpeg's C APIs through N-API. Includes both raw FFmpeg bindings for full control and higher-level abstractions. Automatic resource management via Disposable pattern, hardware acceleration support and prebuilt binaries for Windows, Linux, and macOS.
@@ -521,73 +522,9 @@ If you encounter module resolution errors like `Cannot find module 'lib/binary-s
521
522
 
522
523
  ## Examples
523
524
 
524
- | Example | FFmpeg | Low-Level API | High-Level API |
525
- |---------|--------|---------------|----------------|
526
- | `browser-fmp4` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/browser/fmp4) |
527
- | `browser-webrtc` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/browser/webrtc) |
528
- | `electron-builder` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/electron/builder) |
529
- | `electron-forge` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/electron/forge) |
530
- | `api-abort-signal` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-abort-signal.ts) |
531
- | `api-bitstream-filter` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-bitstream-filter.ts) |
532
- | `api-dash` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-dash.ts) |
533
- | `api-device-capture` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-device-capture.ts) |
534
- | `api-encode-decode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-encode-decode.ts) |
535
- | `api-filter-complex` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex.ts) |
536
- | `api-filter-complex-grid` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex-grid.ts) |
537
- | `api-filter-complex-typed` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex-typed.ts) |
538
- | `api-fmp4` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-fmp4.ts) |
539
- | `api-frame-extract` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-frame-extract.ts) |
540
- | `api-hw-codecs` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-codecs.ts) |
541
- | `api-hw-decode-sw-encode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-decode-sw-encode.ts) |
542
- | `api-hw-raw` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-raw.ts) |
543
- | `api-hw-raw-output` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-raw-output.ts) |
544
- | `api-hw-rtsp` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-rtsp.ts) |
545
- | `api-hw-stream-custom-io` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-stream-custom-io.ts) |
546
- | `api-hw-transcode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-transcode.ts) |
547
- | `api-hw-filter-sync` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-filter-sync.ts) |
548
- | `api-muxing` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-muxing.ts) |
549
- | `api-pipeline-hw-rtsp` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-hw-rtsp.ts) |
550
- | `api-pipeline-progress` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-progress.ts) |
551
- | `api-pipeline-raw-muxing` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-raw-muxing.ts) |
552
- | `api-probe` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-probe.ts) |
553
- | `api-rtp` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-rtp.ts) |
554
- | `api-rtsp-backchannel` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-rtsp-backchannel.ts) |
555
- | `api-scaler` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-scaler.ts) |
556
- | `api-sdp-custom` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sdp-custom.ts) |
557
- | `api-sdp-input` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sdp-input.ts) |
558
- | `api-snapshot` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-snapshot.ts) |
559
- | `api-stream-input` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-stream-input.ts) |
560
- | `api-sw-decode-hw-encode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sw-decode-hw-encode.ts) |
561
- | `api-sw-transcode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sw-transcode.ts) |
562
- | `api-whisper-subtitles` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-whisper-subtitles.ts) |
563
- | `api-whisper-transcribe` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-whisper-transcribe.ts) |
564
- | `frame-utils` | | [✓](https://github.com/seydx/node-av/tree/main/examples/frame-utils.ts) | |
565
- | `avio-read-callback` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/avio_read_callback.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/avio-read-callback.ts) | |
566
- | `avio-async-read-callback` | | [✓](https://github.com/seydx/node-av/tree/main/examples/avio-async-read-callback.ts) | |
567
- | `decode-audio` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/decode_audio.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/decode-audio.ts) | |
568
- | `decode-filter-audio` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/decode_filter_audio.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/decode-filter-audio.ts) | |
569
- | `decode-filter-video` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/decode_filter_video.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/decode-filter-video.ts) | |
570
- | `decode-video` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/decode_video.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/decode-video.ts) | |
571
- | `demux-decode` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/demux_decode.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/demux-decode.ts) | |
572
- | `encode-audio` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/encode_audio.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/encode-audio.ts) | |
573
- | `encode-video` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/encode_video.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/encode-video.ts) | |
574
- | `ffprobe-metadata` | | [✓](https://github.com/seydx/node-av/tree/main/examples/ffprobe-metadata.ts) | |
575
- | `filter-audio` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/filter_audio.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/filter-audio.ts) | |
576
- | `hw-decode` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/hw_decode.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/hw-decode.ts) | |
577
- | `hw-encode` | | [✓](https://github.com/seydx/node-av/tree/main/examples/hw-encode.ts) | |
578
- | `hw-transcode` | | [✓](https://github.com/seydx/node-av/tree/main/examples/hw-transcode.ts) | |
579
- | `qsv-decode` | [✓](https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/qsv_decode.c) | | |
580
- | `qsv-transcode` | [✓](https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/qsv_transcode.c) | | |
581
- | `vaapi-encode` | [✓](https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/vaapi_encode.c) | | |
582
- | `vaapi-transcode` | [✓](https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/vaapi_transcode.c) | | |
583
- | `mux` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/mux.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/mux.ts) | |
584
- | `remux` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/remux.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/remux.ts) | |
585
- | `resample-audio` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/resample_audio.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/resample-audio.ts) | |
586
- | `rtsp-stream-info` | | [✓](https://github.com/seydx/node-av/tree/main/examples/rtsp-stream-info.ts) | |
587
- | `scale-video` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/scale_video.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/scale-video.ts) | |
588
- | `show-metadata` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/show_metadata.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/show-metadata.ts) | |
589
- | `transcode-aac` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/transcode_aac.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/transcode-aac.ts) | |
590
- | `transcode` | [✓](https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples/transcode.c) | [✓](https://github.com/seydx/node-av/tree/main/examples/transcode.ts) | |
525
+ The repository ships 60+ runnable examples covering both API levels — high-level (`api-*`: transcoding, hardware acceleration, RTSP, fMP4/DASH, RTP, Whisper, device capture, …) and low-level ports of the official FFmpeg C examples.
526
+
527
+ **[→ Browse all examples](https://github.com/seydx/node-av/tree/main/examples)**
591
528
 
592
529
  ## Prebuilt Binaries
593
530
 
@@ -1102,10 +1102,8 @@ export class BitStreamFilterAPI {
1102
1102
  return;
1103
1103
  }
1104
1104
  this.isClosed = true;
1105
- // Close queues
1106
1105
  this.inputQueue.close();
1107
1106
  this.outputQueue.close();
1108
- // Free any packets left buffered on an aborted/early-closed pipeline.
1109
1107
  this.inputQueue.clear();
1110
1108
  this.outputQueue.clear();
1111
1109
  this.packet.free();
@@ -1 +1 @@
1
- {"version":3,"file":"bitstream-filter.js","sourceRoot":"","sources":["../../src/api/bitstream-filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,WAAW,E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AK,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;gBAClC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACvC,IAAI,CAAC,SAAS;oBAAE,MAAM;gBACtB,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iEAAiE;YACjE,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;QACxC,CAAC;gBAAS,CAAC;YACT,kEAAkE;YAClE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
@@ -3,9 +3,9 @@ import { Codec } from '../lib/codec.js';
3
3
  import { Frame } from '../lib/frame.js';
4
4
  import { Packet } from '../lib/packet.js';
5
5
  import { Scheduler } from './utilities/scheduler.js';
6
- import type { AVCodecID, AVPixelFormat, AVThreadType, DecoderOptionsFor, EOFSignal, FFDecoderCodec } from '../constants/index.js';
6
+ import type { AVCodecID, AVPixelFormat, AVSampleFormat, AVThreadType, DecoderOptionsFor, EOFSignal, FFDecoderCodec } from '../constants/index.js';
7
7
  import type { Stream } from '../lib/stream.js';
8
- import type { IRational } from '../lib/types.js';
8
+ import type { ChannelLayout, IRational } from '../lib/types.js';
9
9
  import type { Encoder } from './encoder.js';
10
10
  import type { FilterAPI } from './filter.js';
11
11
  import type { HardwareContext } from './hardware.js';
@@ -36,13 +36,6 @@ export interface DecoderOptions<C = unknown> {
36
36
  * Some hardware decoders need extra frames for reference or look-ahead.
37
37
  */
38
38
  extraHWFrames?: number;
39
- /**
40
- * Hardware frame output format.
41
- *
42
- * When set, hardware frames will be automatically transferred to this software pixel format.
43
- * Useful when you need software frames for further processing but want to use hardware decoding.
44
- */
45
- hwaccelOutputFormat?: AVPixelFormat;
46
39
  /**
47
40
  * Force constant framerate mode.
48
41
  *
@@ -68,6 +61,57 @@ export interface DecoderOptions<C = unknown> {
68
61
  * @default false
69
62
  */
70
63
  applyCropping?: boolean;
64
+ /**
65
+ * Resample decoded audio to a target format (audio only).
66
+ *
67
+ * When set, decoded audio frames are transparently converted to the requested
68
+ * sample rate, sample format, and/or channel layout before they are returned —
69
+ * the audio mirror of {@link rescale}. Any omitted field keeps the decoded
70
+ * value, and conversion is skipped entirely when the source already matches the
71
+ * target. Useful when a capture device delivers a rate you cannot control (e.g.
72
+ * avfoundation ignoring a microphone sample-rate request) and you want every
73
+ * downstream stage to receive the rate you asked for.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Guarantee 48 kHz frames regardless of the device's actual rate
78
+ * const decoder = await Decoder.create(stream, { resample: { sampleRate: 48000 } });
79
+ * ```
80
+ */
81
+ resample?: {
82
+ sampleRate?: number;
83
+ sampleFormat?: AVSampleFormat;
84
+ channelLayout?: ChannelLayout;
85
+ };
86
+ /**
87
+ * Rescale decoded video to a target pixel format and/or size (video only).
88
+ *
89
+ * When set, decoded video frames are transparently converted to the requested
90
+ * pixel format and/or dimensions before they are returned — the video mirror of
91
+ * {@link resample}. Any omitted field keeps the decoded value, and conversion is
92
+ * skipped entirely when the source already matches the target.
93
+ *
94
+ * Hardware frames are automatically transferred to a supported software format
95
+ * first and then converted to the requested one; software frames are converted
96
+ * directly. Hardware frames are left untouched (kept on the GPU, zero-copy) when
97
+ * `rescale` is not set. This replaces the former `hwaccelOutputFormat` option:
98
+ * use `rescale: { pixelFormat }` to get decoded frames in a fixed software format.
99
+ *
100
+ * Useful to normalize a heterogeneous set of sources (e.g. RTSP cameras that each
101
+ * deliver a different pixel format) so every downstream stage receives a uniform
102
+ * format/size, regardless of whether a stream was hardware- or software-decoded.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * // Normalize any source to yuv420p, whether it was hardware- or software-decoded
107
+ * const decoder = await Decoder.create(stream, { hardware: hw, rescale: { pixelFormat: AV_PIX_FMT_YUV420P } });
108
+ * ```
109
+ */
110
+ rescale?: {
111
+ width?: number;
112
+ height?: number;
113
+ pixelFormat?: AVPixelFormat;
114
+ };
71
115
  /**
72
116
  * Number of threads to use for decoding.
73
117
  *
@@ -160,6 +204,15 @@ export declare class Decoder implements Disposable {
160
204
  private lastFrameTb;
161
205
  private lastFrameSampleRate;
162
206
  private lastFilterInRescaleDelta;
207
+ private audioResampler?;
208
+ private resampledFrame?;
209
+ private resampleTarget?;
210
+ private resampleInputLayout?;
211
+ private audioResamplerSetup;
212
+ private audioResamplerDrained;
213
+ private videoScaler?;
214
+ private scaledFrame?;
215
+ private hwTransferFormat?;
163
216
  private inputQueue;
164
217
  private outputQueue;
165
218
  private workerPromise;
@@ -1070,6 +1123,113 @@ export declare class Decoder implements Disposable {
1070
1123
  * @internal
1071
1124
  */
1072
1125
  private processAudioFrame;
1126
+ /**
1127
+ * Lazily configure the audio output resampler from the first decoded frame.
1128
+ *
1129
+ * Reads the source format from the frame, resolves the target from
1130
+ * `options.resample` (omitted fields keep the source value), and builds a
1131
+ * `SoftwareResampleContext` only when something actually differs. Runs once.
1132
+ *
1133
+ * @param frame - First decoded audio frame
1134
+ *
1135
+ * @throws {FFmpegError} If the resampler cannot be configured or initialized
1136
+ *
1137
+ * @internal
1138
+ */
1139
+ private setupAudioResampler;
1140
+ /**
1141
+ * Lazily allocate the reused resampler output frame.
1142
+ *
1143
+ * @returns The allocated output frame
1144
+ *
1145
+ * @internal
1146
+ */
1147
+ private getResampleFrame;
1148
+ /**
1149
+ * Resample a decoded audio frame to the target format and clone it for the user.
1150
+ *
1151
+ * `swr_convert_frame` allocates/sizes the output buffer; the sample timestamp
1152
+ * (carried in the frame's own timebase) is preserved, while `nb_samples` and
1153
+ * `sample_rate` reflect the new rate. Returns null when the resampler buffered
1154
+ * the input without emitting samples yet (caller should feed more).
1155
+ *
1156
+ * @param frame - Decoded source audio frame
1157
+ *
1158
+ * @returns Cloned resampled frame owned by the caller, or null if none emitted
1159
+ *
1160
+ * @throws {FFmpegError} If resampling fails
1161
+ *
1162
+ * @internal
1163
+ */
1164
+ private resampleAudioClone;
1165
+ /**
1166
+ * Drain samples buffered inside the resampler (rate-conversion delay) at EOF.
1167
+ *
1168
+ * @returns Cloned drained frame owned by the caller, or null when empty
1169
+ *
1170
+ * @throws {FFmpegError} If draining fails
1171
+ *
1172
+ * @internal
1173
+ */
1174
+ private drainResamplerClone;
1175
+ /**
1176
+ * Resolve (once, then cache) the software format to download hardware frames to.
1177
+ *
1178
+ * When `rescale.pixelFormat` is set and the frame's hardware frames context can
1179
+ * transfer directly to it, that format is used so the subsequent swscale can be
1180
+ * skipped entirely (when no resize is requested) or stay format-preserving. When
1181
+ * it cannot, `AV_PIX_FMT_NONE` is returned so `av_hwframe_transfer_data` picks a
1182
+ * supported format and the swscale handles the final conversion. Cached because
1183
+ * the hardware frames context is stable for the lifetime of the decoder.
1184
+ *
1185
+ * @param frame - First hardware frame (used to read the hardware frames context)
1186
+ *
1187
+ * @returns The download format, or `AV_PIX_FMT_NONE` to let FFmpeg choose
1188
+ *
1189
+ * @internal
1190
+ */
1191
+ private resolveHwTransferFormat;
1192
+ /**
1193
+ * Transfer a hardware frame down to system memory, replacing it in place.
1194
+ *
1195
+ * The destination software format is the requested one when the GPU can transfer
1196
+ * to it directly (see {@link resolveHwTransferFormat}), otherwise one chosen
1197
+ * automatically by FFmpeg. The downloaded data replaces the hardware frame's
1198
+ * contents so the rest of the pipeline operates on a software frame.
1199
+ *
1200
+ * @param frame - Hardware frame to download (modified in place)
1201
+ *
1202
+ * @returns True on success; false when the transfer failed and `exitOnError` is off
1203
+ *
1204
+ * @throws {FFmpegError} If the transfer fails and `exitOnError` is enabled
1205
+ *
1206
+ * @internal
1207
+ */
1208
+ private transferHwFrameToSoftware;
1209
+ /**
1210
+ * Lazily allocate the reused rescaler output frame.
1211
+ *
1212
+ * @returns The allocated output frame
1213
+ *
1214
+ * @internal
1215
+ */
1216
+ private getScaledFrame;
1217
+ /**
1218
+ * Convert a (software) video frame to the requested `rescale` pixel format and/or
1219
+ * size, replacing it in place.
1220
+ *
1221
+ * Each omitted target field keeps the source value, and the conversion is skipped
1222
+ * entirely when the frame already matches. The swscale context is configured
1223
+ * lazily from the first frame that needs conversion. `sws_scale_frame` copies the
1224
+ * frame properties (timing, colorimetry, aspect ratio).
1225
+ *
1226
+ * @param frame - Software video frame to convert (modified in place)
1227
+ *
1228
+ * @throws {FFmpegError} If the rescaler fails to configure or convert and `exitOnError` is enabled
1229
+ *
1230
+ * @internal
1231
+ */
1232
+ private rescaleVideoInPlace;
1073
1233
  /**
1074
1234
  * Dispose of decoder.
1075
1235
  *