I want to encode my videos (rm , wmv , flv, avi formats) to H.264 MOV or MP4 in HQ so I can upload them to Youtube.

1.Can anyone suggest me a free software encoder or converter?

2. What do I have to do if I want my videos to have the "High Quality " Button? Does it really have to be in H.264??