Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I want to detect if file is video file or not in c#
Posted
Updated 14-Jun-12 23:53pm
v2

1 solution

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
 
Share this answer
 
Comments
VJ Reddy 15-Jun-12 6:19am    
Good answer. 5!
Manas Bhardwaj 15-Jun-12 6:24am    
thnx!
Sandeep Mewara 15-Jun-12 11:52am    
Good answer. 5!
Manas Bhardwaj 15-Jun-12 17:07pm    
thanks Sandeep!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900