开发者

How do I generate a content type string with codecs for a media file?

开发者 https://www.devze.com 2022-12-14 05:08 出处:网络
Is there a command-line tool that sniffs video/audio files and generates detailed content-type strings for them, in the format specified in the HTML5 spec and in RFC4281?

Is there a command-line tool that sniffs video/audio files and generates detailed content-type strings for them, in the format specified in the HTML5 spec and in RFC4281?

I want to use this serverside to avoid recoding of uploaded MP4 and OGG files whenever the encoding is supported by HTML5 browsers. V开发者_JS百科ideo hosting sites have opted to recode everything, which I think is the wrong approach because it means either long uploading times or low quality.


I don't believe there is any ready-made application that will do this. However, if you're running on a Linux-like environment, the file utility will identify many filetypes by content sniffing.

file won't spit out RFC-compliant MIME types directly, but converting its output to whatever MIME types you're interested in should be a pretty simple task.

0

精彩评论

暂无评论...
验证码 换一张
取 消