Anyone know of a reference for mapping ffmpeg format values to MIME types and recommended file extension? My google attempt failed to turn up anything.
I did manually put together a small list with guess-work and clues from Wikipedia, IANA, and the Mozilla Developer Network for the subset of formats that I encountered in my video input test collection:
ffmpeg Format Extension MIME Type
─────────────────────── ───────── ──────────────────────
asf asf application/vnd.ms-asf
avi avi video/x-msvideo
flv flv video/x-flv
matroska,webm webm video/webm
m4v m4v video/x-m4v
mov,mp4,m4a,3gp,3g2,mj2 mp4 video/mp4
mpeg mpeg video/mpeg
mpegts mpeg video/mpeg
mpegvideo mpeg video/mpeg
ogg ogv video/ogg
matroska mkv video/x-matroska
webm webm video/webm
No idea if I've made the right calls, though.
(The test files already have file extensions, but I'm operating on the assumption that the extension of a file a user uploads is irrelevant, and that the file should be renamed based on ffprobe and intelligent mapping...)