Request for Mencoder Command for H264 with this spec

Hi guys, thanks for looking at my thread. I tried for several hours to use mencoder to convert my mkv to mp4 with this spec

Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf52.62.0
Duration: 00:12:00.01, start: 0.000000, bitrate: 761 kb/s
Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 580x328 [PAR
1:1 DAR 145:82], 699 kb/s, 23.97 fps, 23.98 tbr, 2997 tbn, 47.95 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 58 kb/s
Metadata:
creation_time : 1970-01-01 00:00:00

Anyone can help me with the command line for converting to such output, thanks a lot ! I am using mencoder / ffmpeg , fine with either.

But my input is avi or mkv