I bought a small mpg player for my son and now he want to look video on this small screen.
There is a exampe AVI on the device and ffmpeg -i tell me for this file:
Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 160x128 [SAR 1:1 DAR 5:4], SAR 65536:65535 DAR 16384:13107, 15 tbr, 15 tbn, 15 tbc
after some investigation I found nearly the right command to convert other avis into this format.
The "SAR 65536:65535 DAR 16384:13107" is nothing more than bad math programming by whatever crappy framework encoded the file.
Your problem might be that the player does not recognize the fourcc code. Notice that the fourcc code from the sample is 0x44495658 while your encode is 0x64697678. Edit the fourcc to use upper case "XVID" rather than lower case "xvid" and see if that makes it happy.
If it's just sync drift, there are async and vsync options that can help deal with that, as well as itsoffset to compensate for delay. However for what you are talking about, it would seem that ffmpeg is miscalculating what the original framerate for the input file is. Try manually specifying the input frame rate of the video by setting another -r options, _before_ the -i options to force the input framerate.
Of course, if the file plays ok with ffplay, it may just be something odd about the device.
Oh, and one more thing, AVI files are absolutely horrible with codecs employing I-P-B frames. If the device supports any other type of container format like MPEG-PS you would be better off trying to mux the streams into that type of container format. Another approach is to encode Intra-frame only. (No P or B frames)