Skip to content

Instantly share code, notes, and snippets.

@DusanBrejka
Last active August 12, 2020 13:21
Show Gist options
  • Save DusanBrejka/95660a9b6f194fefd69d40f91407b112 to your computer and use it in GitHub Desktop.
Save DusanBrejka/95660a9b6f194fefd69d40f91407b112 to your computer and use it in GitHub Desktop.
FFMPEG - map of muxers to default mime types
// This can generated by executing the command below:
// ffmpeg -muxers -hide_banner | tail -n +5 | cut -d' ' -f4 | xargs -i{} ffmpeg -hide_banner -h muxer={} | pcregrep -o2 -o4 -M '(Muxer (\w+) )|(Mime type:( .*).)'
// And then parsing the output with regex to JSON format in JavaScript for example:
// str.match(/(.*)\n (.*)/gm).map(m => `"${m.replace(/\n /, '": "')}"`).join(',\n');
const muxer2mime = {
"ac3": "audio/x-ac3",
"adts": "audio/aac",
"aiff": "audio/aiff",
"amr": "audio/amr",
"apng": "image/png",
"asf": "video/x-ms-asf",
"asf_stream": "video/x-ms-asf",
"ass": "text/x-ass",
"au": "audio/basic",
"avi": "video/x-msvideo",
"avm2": "application/x-shockwave-flash",
"bit": "audio/bit",
"caf": "audio/x-caf",
"dts": "audio/x-dca",
"dvd": "video/mpeg",
"eac3": "audio/x-eac3",
"f4v": "application/f4v",
"flac": "audio/x-flac",
"flv": "video/x-flv",
"g722": "audio/G722",
"g723_1": "audio/g723",
"gif": "image/gif",
"gsm": "audio/x-gsm",
"h261": "video/x-h261",
"h263": "video/x-h263",
"ico": "image/vnd.microsoft.icon",
"ilbc": "audio/iLBC",
"ipod": "video/mp4",
"ismv": "video/mp4",
"jacosub": "text/x-jacosub",
"latm": "audio/MP4A-LATM",
"matroska": "video/x-matroska",
"microdvd": "text/x-microdvd",
"mjpeg": "video/x-mjpeg",
"mmf": "application/vnd.smaf",
"mp2": "audio/mpeg",
"mp3": "audio/mpeg",
"mp4": "video/mp4",
"mpeg": "video/mpeg",
"mpeg1video": "video/mpeg",
"mpegts": "video/MP2T",
"mpjpeg": "multipart/x-mixed-replace;boundary=ffserver",
"mxf": "application/mxf",
"mxf_d10": "application/mxf",
"mxf_opatom": "application/mxf",
"nut": "video/x-nut",
"oga": "audio/ogg",
"ogg": "application/ogg",
"ogv": "video/ogg",
"oma": "audio/x-oma",
"opus": "audio/ogg",
"rm": "application/vnd.rn-realmedia",
"singlejpeg": "image/jpeg",
"spx": "audio/ogg",
"srt": "application/x-subrip",
"sup": "application/x-pgs",
"svcd": "video/mpeg",
"swf": "application/x-shockwave-flash",
"tta": "audio/x-tta",
"vcd": "video/mpeg",
"vob": "video/mpeg",
"voc": "audio/x-voc",
"wav": "audio/x-wav",
"webm": "video/webm",
"webm_chunk": "video/webm",
"webm_dash_manifest": "application/xml",
"webvtt": "text/vtt",
"wv": "audio/x-wavpack"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment