Wrong encoder width and height

There was constant values for width and height in the code. 
In my case this causes that FFMPEG produces incorrect output video frames.