检查文件是否为视频文件 [英] To check if file is video file or not

查看:101
本文介绍了检查文件是否为视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c#

推荐答案

方法1 中检测文件是否为视频文件:最简单-文件名解析.如果文件名匹配视频文件类型的已知列表(即avi mp4 mpeg等),则它匹配视频文件.这并不是那么可靠,因为我可以轻松地将扩展名为.avi的文本文件命名为文件,但这并不一定使它成为视频文件.

方法2 :更难-解析文件头.例如,在 CodeProject [
Method 1: Easiest - File name parsing. If the filename matches a known list of video file types (i.e. avi mp4 mpeg etc), then it matches a video file. This is not as robust since I can easily name a text file with the extension .avi, but that does not necessarily make it a video file.

Method 2: Harder - Parse file header. For example, at CodeProject [^]there is a C# RIFF Parser


这篇关于检查文件是否为视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆