We look at the videos bitrate for this. If the bitrate is larger than 4772 Kbps (Calculated using a 2 hour video file with the size 4GB) we transcode it down to 1080p.
The rationale was making videos streamable for people with 5Mbps Internet.
If the bitrate is smaller and the MKV has H264 content in it we "re-container" instead of transcode, so you'll get the streamable file faster.
All of this is triggered when you visit the video page, if the video is not already MP4.