I used this below mentioned cmd to compress an avi file(using ubuntu)
ffmpeg -i input.avi -vcodec msmpeg4v2 output.avi
but I am getting these errors
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x9cd1fa0] invalid bit rate
Error while opening encoder for output stream #0.1 - maybe incorrect
parameters such as bit_rate, rate, width or height
What's wrong?

ffmpeg -c:v libx264 -c:a copy -crf 23 -preset sloweris much better (change-crf 23to change the quality; lower = better quality. 18 is often considered visually lossless; you can go much higher). This encode will take a long time, even on fast hardware. Pick a different preset if its too slow. Also, if possible, use mkv or mp4 for the output format. – derobert Apr 8 at 16:21