The steps is based on the findings in this video. If you need step by step instructions, play it, otherwise read my post that follows.
It's well known that you can link to the high quality version. If the url of the video is http://www.youtube.com/watch?v=hLtTNE61iik, the video of the HQ version is at http://www.youtube.com/watch?v=hLtTNE61iik&fmt=18
To embed is slightly different. The code to append to the url on the embed codes is
&ap=%2526fmt%3D18. Note that the url appears twice in the embed codes.
To ensure you have the HQ version, you need to do a few things.
Size: it must be 480x360 or above. If you have 4:3, the maximum dimension is 640x480. If you have wide screen 16:9, you can just use 640x360 without letter boxing yourself.
Frame rate: 24 fps works (vimeo uses), PAL is 25 and NTSC is 29.97. 30 fps will work too. Use 24 min.
Video codec: youtube said Divx or Xvid. Actually H.264 will work too. The trick is to configure the codec to use CBR (constant bit rate) and force the bit rate to over 1000 kbps.
File format: avi or mp4 will work (mov and wmv should do too). Strictly speaking H.264 and mp4 is the "real" mpeg4 standard.
Audio: MP3 and AAC will do. AAC is the "real" mpeg4 standard.
Free software is either Avidemux for mp4 compliance, or VirtualDub for popularity.
Avidemux: choose x264 for video AAC for audio and mp4 for file format. In the first main option menu, select encoding mode to be Constant Bitrate, and use the default 1500 kb/s. All codecs are built-in. If you want smaller files you can use 2 passes. Avidemux will do it automatically whereas in VirtualDub you have to config the codec twice, as in video above.
VirtualDub: you have to install the Video For Windows codec x264vfw. (Google for the download link.) As the video above suggests, name the output .avi file, select x264 codec. Configure the codec - the first bitrate option is Multipass - 1st pass. This allow us to pick the target bit rate - set as 1000 kb/s or higher. Then save as xxx.avi. For the 2nd pass, configure the codec to use Multipass - N pass, while everything the same. Then save as xxx.avi and overwrite the file in the 2nd pass.
Of course, if you upload to Vimeo instead, you have full 1280x720 resolution, HD 720p resolution, which is as good as 1024p until your TV is bigger than 50" and you sit close to it. (from some reviews)
For any resolution I use Avidemux x264/AAC/MP4. Vimeo is less fussy about the codec configuration. It accepts the default variable bit rate, while Youtube have to be constant bit rate larger than 600 kb/s to differentiate between "high def" and normal def.