Getting 500 error when uploading video to twitter from android app



I am trying to compress video using FFMPEGAndroid library using the following command.
{"-y" ,"-i", file.getAbsolutePath(),
"-c:v", “libx264”, “-crf”, “20”,
"-aspect", “1:1”,
"-pix_fmt", “yuv420p”,
"-c:a", “aac”, “-strict”,“experimental”,
"-b:a", “96k”, “-ac”, “2”, “-ar”, “44100”,
"-preset", “ultrafast”,

When i try to share the video on Twitter from my android app, i get 500 Internal Server Error. I am able to share same video on Facebook.
I have been read a lot of forums and FFMPEG manuals but no luck.

I will really appreciate if anyone can provide inputs on this.