ofxStreamer icon indicating copy to clipboard operation
ofxStreamer copied to clipboard

Sender example compiles but crashes

Open jeppius opened this issue 9 years ago • 6 comments

Erratic. I managed to make it work just a few times. I can't see any consistent reason why. When it works it sends correctly the stream to the Receiver.

It consistently fails at streamerSenderExampleDebug`swscale at swscale.c:304: 0x537585: movl %esi, %eax

It crashes at the first frame, but sometimes a few frames later, even a few seconds later.

jeppius avatar May 16 '15 09:05 jeppius

see similar crashes here on swscale:

screen shot 2016-03-03 at 11 44 41 am

ofZach avatar Mar 03 '16 16:03 ofZach

glancing over the code i think it's possible that QTKitGrabber could return the wrong size until the first frame arrives, maybe something like this could do the trick:

grabber.initGrabber(...); grabber.update(); // fetch a frame sender.setup(grabber.getWidth(), grabber.getHeight(),...); // now set up the sender

fun fact: if you take the crash address minus the start address of _data, you get exactly 640_480*3.

kritzikratzi avatar Mar 03 '16 17:03 kritzikratzi

that's a fun fact :) I tried that but it seems to be ok. I suspect it maybe has to do with pixel alignment ? http://stackoverflow.com/questions/34450151/ffmpeg-bmp-to-yuv-crash-at-sws-scale I don't know enough here, but poking around...

ofZach avatar Mar 03 '16 21:03 ofZach

Uh... this issues gives me flashbacks of nightmares from when i created this addon... ffmpeg.......

HalfdanJ avatar Mar 03 '16 21:03 HalfdanJ

Same issue around here. Would anyone have a light on how to solve this?

jeraman avatar Apr 06 '17 19:04 jeraman

This issue still persists.

using height-1 in the crashing line seems to be working more or less.

sws_scale(imgctx, (const uint8_t* const*) &data, &stride, 0, height-1, frame->data, frame->linesize);

gaborpapp avatar Nov 14 '17 12:11 gaborpapp