Closed oierlauzi closed 5 years ago
You can't memcpy just width * height
bytes from frame->Data[0]
, since the stride is not necessarily the width, and also AV_PIX_FMT_RGBA is a packd format; this is how video works in every framework/codebase/etc/in general. RGBA happens to have only one plane (since it is packed), but other formats will have more, anda just Data[0]
may not be sufficient.
You'd need to do something like this for RGBA:
uint8_t *buf = malloc(width * height * 4);
if (buf == NULL) {
//error
}
for (int y = 0; y < frame->Height; y++) {
memcpy(buf + width * y * 4, frame->Data[0] + y * frame->Linesize[0], width * 4);
}
Closing as this isnt a FFMS2 bug.
See this explanatory MSPaint document:
Hello. I'm getting strange output results with FFMS2. Here goes a pic.![imagen](https://user-images.githubusercontent.com/14185744/43012329-50b8a24c-8c46-11e8-9ec3-767a90a14eba.png)
The code I'm using is pretty similar to the one in the documentation pages. However I'll attach it:
FFMS_Init(0, 0)
has been executed beforewhere
createPagadiMemFrame
mempy-s the given data EDIT: if I set up FFMS_ErrorInfo, it gives no error message EDIT2: Using FFMS_GetPixFmt("rgba"); does not solve the problem