如何为媒体文件生成带有编解码器的内容类型字符串?
是否有一个命令行工具可以嗅探视频/音频文件并以指定的格式为它们生成详细的内容类型字符串HTML5 规范 和 RFC4281 中?
我想使用此服务器端来避免在 HTML5 浏览器支持编码时对上传的 MP4 和 OGG 文件进行重新编码。视频托管网站选择重新编码所有内容,我认为这是错误的方法,因为这意味着上传时间长或质量低。
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. Video hosting sites have opted to recode everything, which I think is the wrong approach because it means either long uploading times or low quality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信有任何现成的应用程序可以做到这一点。但是,如果您在类似 Linux 的环境中运行,
file
实用程序将通过内容嗅探来识别许多文件类型。file
不会直接输出符合 RFC 的 MIME 类型,但将其输出转换为您感兴趣的任何 MIME 类型应该是一个非常简单的任务。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.