视频中的总帧数,紧急!!! [英] Total number of frames in a video, Urgent!!!
问题描述
大家好,
我无法相信我无法在互联网上找到我的问题的解决方案而且我几乎忘记了!
I cannot believe that i could'nt find the solution to my problem in the internet and i am almost out of my mind!!!
我使用samplegrabber来捕捉和处理来自不同类型视频的帧:.avi,mpeg,.wmv ...
I am using samplegrabber to cature and process frames from different types of videos: .avi, mpeg, .wmv...
打开视频文件时,我需要知道帧的总数。我使用以下内容:
I need to know the total number of frames as I open the video file. I use the following:
//获取视频信息
// Get video info
m_pSeeking-> GetDuration(& m_lDuration);
m_pSeeking->GetDuration(&m_lDuration);
if (FAILED(m_pSeeking-> SetTimeFormat(& TIME_FORMAT_FRAME)))
if(FAILED(m_pSeeking->SetTimeFormat(&TIME_FORMAT_FRAME)))
m_nTotalFrames = m_lDuration / m_lTimeperFrame;
m_nTotalFrames = m_lDuration / m_lTimeperFrame;
else
else
m_pSeeking-> GetDuration (& m_nTotalFrames);
m_pSeeking->GetDuration(&m_nTotalFrames);
但是,对于某些视频,它并没有给我正确的帧数。
However, for some videos it does not give me the correct number of frames.
有人可以告诉我一种方法来查找视频文件中的总帧数。我没有经验,所以请给我一些代码。有些人给了我一些答案,比如"使用IMediaSeeking"等。但我无法解决我的问题。因此,如果您知道答案,请提供2-3行代码。
Could someone advise me a way to find the total number of frames in a video file. I am not experienced in directshow, so please give me some code piece. Some people gave me some answers like "use IMediaSeeking" but i could not solve my problem. Therefore, please provide some 2-3 lines of code if you know the answer.
谢谢......
推荐答案
您可以尝试IQualProp :: get_FramesDrawn 界面。
要获得确切的帧数,请禁用DirectShow系统时钟,以便不丢弃帧。
To get the exact number of frames, disable the DirectShow system clock so that frames are not dropped.
这篇关于视频中的总帧数,紧急!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!