For a long time, I can't figure out why 480p or 640x480 videos are stretched by YouTube. The output resolution is still the same but they seems to be rescaled in Y-axis. This should be much problem for your daily life video, but it is for screencasting. They looks like 90s homemade video in analogy, just terrible.

You can see an example in my previous video like this one. I used the following command to record:
~/p/x11grabr/x11grabr -b -s 640x480 | ffmpeg -f rawvideo -pix_fmt bgra -s 640x480 -r 25 -i - -vcodec libx264 -vpre lossless_ultrafast -strict experimental -threads 0 test.mkv

 ~ $ mediainfo test.mkv 
General
Unique ID                                : 107803120395874480459111442715539922352 (0x511A2032421B3E79424266CB5EDBDDB0)
Complete name                            : test.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 584 KiB
Duration                                 : 2s 480ms
Overall bit rate                         : 1 929 Kbps
Writing application                      : Lavf52.111.0
Writing library                          : Lavf52.111.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:4:4 Predictive@L3.0
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 2s 480ms
Bit rate                                 : 1 891 Kbps
Width                                    : 640 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Variable
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.246
Stream size                              : 572 KiB (98%)
Writing library                          : x264 core 115
Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=0 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=cqp / mbtree=0 / qp=0
Language                                 : English
Default                                  : Yes
Forced                                   : No
Today I finally found a way to get around the problem by using WebM:
~/p/x11grabr/x11grabr -b -s 640x480 | ffmpeg -f rawvideo -pix_fmt bgra -s 640x480 -r 25 -i - test.webm

 ~ $ mediainfo test.webm 
General
Unique ID                                : 162746949293301742131061222707439175632 (0x7A6FEC1BDD11DE98A5F24CEB620587D0)
Complete name                            : test.webm
Format                                   : WebM
Format version                           : Version 2
File size                                : 203 KiB
Duration                                 : 2s 40ms
Overall bit rate                         : 815 Kbps
Writing application                      : Lavf52.111.0
Writing library                          : Lavf52.111.0

Video
ID                                       : 1
Format                                   : VP8
Codec ID                                 : V_VP8
Duration                                 : 2s 40ms
Bit rate                                 : 776 Kbps
Width                                    : 640 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 25.000 fps
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.101
Stream size                              : 193 KiB (95%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
The quality is poorer because it needs to tune a bit, but at least YouTube won't mess it up, here is an example output.

The strange thing is 720p is fine, I don't understand what's going on and I won't bother to post in help forums because I doubt their engineer will read my question. YouTube Guru in forums? (Not sure about what YouTube staff name those volunteers) No offense, nah, but thanks anyway.
YouTube never mentioned problem with the video codec, no issue was reported except the file didn't have audio codec it recognizes. To YouTube: some videos are meant to have no audio tracks.

Anyway, if you know anything about the issue which I can still use AVC, please let me know. I am guessing it could be those encoding setting, but it's a long list and 99.999% of them I have no idea what they are for.