hi I wants to get video file duration in C#. I have the to get video file duration but code works only local computer. If i deploy my code on server and upload a video file then this code gives error. I m using the following code to get video time.
using QuartzTypeLib;
string file1 = "c://ds.mpeg"
IMediaPosition m_objMediaPosition = null;
FilgraphManager m_objFilterGraph = new FilgraphManager();
m_objFilterGraph.RenderFile(filename);
m_objMediaPosition = m_objFilterGraph as IMediaPosition;
int s = (int)m_objMediaPosition.Duration;
int h = s / 3600;
int m = (s - (h * 3600)) / 60;
s = s - (h * 3600 + m * 60);
string time = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
lblmsg.Text = time.ToString();
m_objMediaPosition = null;
m_objFilterGraph = null;
Have u any code which return time duration of a uploaded video file.