-f also supports some symbolic names, which is very handy because it allows you to easily get the best possible quality without having to check the formats every time:
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'
this is what I'm using in my case (on youtube).Posting this here, because it's not obvious from the docs that this works.