Converting media to m4v format using ffmpeg

Can anyone help me convert media to m4v format. I guess ffmpeg would
be a nice choice coz I have a rails application where I need to do the
conversion. I google, but could not find the solution.

BTW I am using jplayer for playing video which only takes m4v video
file and thats the reason I need to convert video submitted by user.

Thanks in advance.