# convert with default settings
ffmpeg -i input.mkv output.mp4
# convert to mp4 using nvidia nvenc
# where -b:v is suitably set, e.g 2M for 720p
ffmpeg -i input.mkv -c:v h264_nvenc -b:v 4M output.mp4
# as above but don't re-encode audio
ffmpeg -i input.mkv -c:v h264_nvenc -b:v 4M -c:a copy out.mp4
# extract audio as wav
ffmpeg -i input.mp4 output.wav
# extract aac audio from mp4
ffmpeg -i input.mp4 -vn -c:a copy output.m4a
# don't reencode anything (just change metadata or container format)
ffmpeg -i input.mp4 -c copy output.webm
# don't reencode audio, but scale video
ffmpeg -i input.mp4 -c:a copy -vf scale=w=1280:h=720 output.mp4
Metadata
# extract metadata
ffmpeg -i input.mp4 -f ffmetadata metadata.txt # writes metadata to metadata.txt
# applying metadata
ffmpeg -i input.mp4 -f ffmetadata -i metadata.txt -map_metadata 1 ...other_opts... output.mp4
# specifying metadata
ffmpeg -i input.mp4 -metadata artist="Mr Flibble" -metadata title="Hex Vision" -c copy output.mp4