<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>Sorry I'm not much of help, but if I want to answer your questions correctly then I have to investigate your code and do some debugging.<br><br></div>However, I can suggest you what to do. First of all, change your code and study its behaviour. If you are suspicious that type casts are incorrect, then change them to something else (or don't cast at all) and see what happens. And if you are suspicious about allocations, one other alternative is to use av_malloc. First you should get the size with avpicture_get_size though.<br></div>One more suggestion is to play with the Y, U, V, Grey limits that you have defined and see how it changes the output.<br><br></div>Good luck,<br></div>Maziar Mehrabi<br></div>