node-av / lib / avImageCopyToBuffer
Function: avImageCopyToBuffer()
avImageCopyToBuffer(
dst,dstSize,srcData,srcLinesize,pixFmt,width,height,align):number
Defined in: src/lib/utilities.ts:625
Copy image to buffer.
Copies image data from separate planes to a single contiguous buffer.
Direct mapping to av_image_copy_to_buffer().
Parameters
dst
Buffer
Destination buffer
dstSize
number
Destination buffer size
srcData
Source data planes
Buffer<ArrayBufferLike>[] | null
srcLinesize
Source bytes per line
number[] | null
pixFmt
Pixel format
width
number
Image width
height
number
Image height
align
number
Buffer alignment
Returns
number
Bytes written, or negative AVERROR
Example
typescript
const buffer = Buffer.alloc(bufferSize);
const written = avImageCopyToBuffer(
buffer, bufferSize,
srcPlanes, srcStrides,
AV_PIX_FMT_YUV420P, 1920, 1080, 1
);See
av_image_copy_to_buffer - FFmpeg Doxygen
