Skip to content

Conversation

stepancar
Copy link

@stepancar stepancar commented Sep 19, 2025

Currently beamcoder crashes when we try to access frame.data for videos with YUVA format.
Didn't really noticed this issue because we use filter https://github.com/Lumen5/framefusion/blob/main/src/backends/beamcoder.ts#L95
This filter helps because it always makes buffers squential
This requires additional time on CPU. This happens always even if input pixel format is equa output pixel format.
Ideally, we don't need to use those filters. we could get raw pixels data instead.

Lumen5/framefusion#73
https://github.com/Lumen5/luminary/pull/7748

}
REJECT_STATUS;

c->status = napi_create_external_buffer(env, c->readLen, c->readBuf, readFinalizer, (void*)(uint64_t)c->readLen, &result);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, DONT LOOK AT THIS CHANGE

status = napi_get_null(env, &result);
} else {
hintRef = av_buffer_ref(p->packet->buf);
status = napi_create_external_buffer(env, hintRef->size, hintRef->data,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, DONT LOOK AT THIS CHANGE

status = napi_create_external_buffer(env, size, data, frameBufferFinalizer, ref, &element);
// For other planar formats, adjust with chroma subsampling if needed
else if (desc->log2_chroma_h && x > 0) {
plane_h = (frame->height + (1 << desc->log2_chroma_h) - 1) >> desc->log2_chroma_h;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣
absolutely wild bitwise operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants