Youtube convert my video on bad quality I have some problem with video and its representation on youtube. When I upload video which was encoded with MPEG4 or H.264 codec, I get bad quality video after youtube processing.

What is this video. And what is my task. 
I get source video from Iphone, Ipad, Ipod. Format of this video is - mp4. Then, I decode this video on frames with Java Library - Xuggler. This library is a wrapper of ffmpeg. After some filters on frames, I encode this frames on final video. I use codec MPEG-4 and try H.264, final format - mp4. And this final video is fine. It has the same quality as source video, when I play this video on Windows Media Player. But, when I upload video on youtube, after processing I get video with bad quality.

This is characteristics of source video, after uploading on youtube it doesn't lose quality:



And this is characteristics of final video. It loses quality after youtube processing:
This is just a result of the compression that Youtube chooses to apply.  Your initial data rate for the video (3.5 megabits for an SD video) is exceptionally high and not really designed for streaming.  Youtube probably sees that it is only an SD stream and then drops the bit-rate accordingly.

It may not be possible to get better quality since Youtube's system decides what compression settings to apply for their transcode, however you could try submitting videos which match with Youtube's suggested transcode settings and that might help.