What Timewarp writes. Render MP4 saves H.264 video with AAC-LC audio at 44.1 or 48 kHz, 192 kbps stereo. That's the format X recommends, and it plays everywhere else too.
Free X accounts can post videos up to 2 minutes 20 seconds and 512 MB. They play back at 720p.
X Premium raises that to 4 hours and 16 GB on the web, with 1080p playback and 4K uploads.
Song longer than 2:20? Post a clip: trim the finished MP4 in any video editor, or load a shorter edit of the song.
Bitrate. X re-encodes every upload, so 16 Mbps at 1080p is plenty. Higher settings only make a bigger file and a slower upload. Keep 40 or 80 Mbps for a master copy.
Render or record? For posting, use Render MP4. Real-time recordings can drop frames, and some browsers save them as WebM, which X won't accept.
X changes these limits from time to time. Current rules are on help.x.com.