ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
Note that lower CRF values correspond to higher bitrates, and hence produce higher quality videos.
ffmpeg -i input.mp4 -c copy -metadata title="Your Title" -metadata artist="spaceman" -metadata comment="Comments go here" output.mp4
By default, FFmpeg supports the limited number of iTunes tags in the MP4 format. These are listed below. But custom tags can be written if -movflags use_metadata_tags is added. This applies both for adding new tags or carrying over custom global tags from the input.
iTunes tags supported in MP4:
"title"
"artist"
"album_artist"
"composer"
"album"
"date"
"encoding_tool"
"comment"
"genre"
"copyright"
"grouping"
"lyrics"
"description"
"synopsis"
"show"
"episode_id"
"network"
"episode_sort"
"season_number"
"media_type"
"hd_video"
"gapless_playback"
"compilation"