Fixed The problem with -bufsize 512K being before -vcodec libx264 and changed -b  to -b:v  because of the warning  'Please use -b:a or -b:v, -b is ambiguous'.