Finally, I ended up capturing at 640x480, trimming it to 480x480, splitting it into frames using ffmpeg, and then when the frames are combined back into the video using ffmpeg, it scales to 640x640.
String[] ffmpegCommand = {"/sdcard/frames/ffmpeg", "-i", "/sdcard/frames/test.3gp", "-vf", "crop=480:480:80:0,transpose=1", "-r", "30", "-an", "-qscale:v", "2", "-vsync", "1", "-threads", "4", "/sdcard/frames/image%03d.jpg"};
Transpose = 1 is required when the application is running in portrait mode.
Note. When capturing to display only that part of the video that will be included in the final cropped video, I added two black bars of 80 pixels over the preview screen to hide 80 pixels on both sides of the video, which is later cropped. Thus, the user gets what he sees in the preview.
source share