You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -145,8 +145,8 @@ You can also use `createBufferedOutputStream`. That tells the library to save ou
145
145
146
146
You have to set output format to mjpeg and then split the stream manually by looking at the bytes. You can implement a transform stream which does this:
147
147
148
-
```ts
149
-
const { Transform } =require("stream")
148
+
```js
149
+
import { Transform } from"node:stream"
150
150
151
151
classExtractFramesextendsTransform {
152
152
constructor(magicNumberHex) {
@@ -191,7 +191,7 @@ class ExtractFrames extends Transform {
191
191
And then use it like that:
192
192
193
193
```js
194
-
const { Converter } =require("ffmpeg-stream")
194
+
import { Converter } from"ffmpeg-stream"
195
195
196
196
constconverter=newConverter()
197
197
@@ -217,7 +217,7 @@ converter.run()
217
217
> But now want to do it from my node js application automatically.
218
218
219
219
```js
220
-
const { Converter } =require("ffmpeg-stream")
220
+
import { Converter } from"ffmpeg-stream"
221
221
222
222
constframes= ["frame1.jpg", "frame2.jpg", ...etc]
223
223
@@ -259,8 +259,8 @@ You can turn your main stream into series of `jpeg` images with output format `m
259
259
Then pipe it to second ffmpeg process which combines `jpeg` images into video.
260
260
261
261
```js
262
-
constfs=require("fs")
263
-
const { Converter } =require("ffmpeg-stream")
262
+
import*asfsfrom"node:fs"
263
+
import { Converter } from"ffmpeg-stream"
264
264
265
265
// create the joiner ffmpeg process (frames to video)
266
266
constjoiner=newConverter()
@@ -276,7 +276,7 @@ let streaming = false
276
276
/**
277
277
* A function which streams a single video.
278
278
*
279
-
* @param{stream.Readable}incomingStream - The video stream.
279
+
* @param{import("node:stream").Readable}incomingStream - The video stream.
280
280
* @param{string}format - The format of the video stream.
281
281
*
282
282
* @returns{Promise<void>} Promise which resolves when the stream ends.
0 commit comments