On Friday 09 January 2009 10:30, V?ctor Paesa wrote:
Romulo Fernandes said:
I'm using libswscale to scale and convert pixel format from frames that I capture from the screen. In my windows build the frames that I capture are in DIB format. I'm using FFMPEG SVN rev 16437.
Calling sws_scale normally I get the image correctly, except that it's vertically flipped.
If I change the srcSliceY from 0 to srcHeight and srcSliceH from srcHeight to 0, I get a grey image (with correct dimensions). If I keep the srcSliceY in 0 and change srcSliceH from srcHeight to -srcHeight, I also get that grey image.
Is there a way to make sws_scale flip the image for me ?
I faintly recall that using a negative value for some vertical parameter flips it. Don't remember more, you'll need to search the mail archives or run some experiments.
I am not sure on the details either anymore (has been a while since I last worked on swscale), but I think you can use a negative stride for either the source or the destination image. In that case, you also need to point to the last scanline, instead of the first. --Ivo