Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get the video from USB2.0 carame in directshow.However,because of it's high resolution,the fram rate decrease after video datas pass the transform filter.
the camera supports resolution of 1920*1080 30fps,by testing the time spending in transform filter,i known it costs 15ms.Why the frame rate is only 1000/(33.3+15)=20.7 rather 30.It seems that processing data and fetching data are performed synchronously.I want to acheive that the filter fetch data during the transform filter processes the video datas.
I'm not sure if i describe the question clearly.I'm really thanks your help!

What I have tried:

I try to use Multithreading to solve it but failed.

[EDIT CHill60 - OP code from comment]
C++
HRESULT CCsSobelV2::Transform(IMediaSample *pIn, IMediaSample *pOut)
 {
 /*while (!condition)
 {

 } */ 
 HRESULT hr = Copy(pIn, pOut);//Copy the input buffer input to the output buffer, the execution time is approximately 2ms
 if (FAILED(hr))
 return hr; 
 return Transform(pOut);//Custom transformation of the data in the output buffer

}
the code above is Transform() function which has been override.The truth is if Transform(Pout) costs 10ms,the frame rate will be 1000/(33.3+10)fps.PS:my camera provides 1920*1080 video at 30fps
Posted
Updated 5-Jul-18 7:26am
v2
Comments
CHill60 5-Jul-18 7:55am    
We can't see your code so we can't really help
Member 13775524 5-Jul-18 9:00am    
HRESULT CCsSobelV2::Transform(IMediaSample *pIn, IMediaSample *pOut)
{
/*while (!condition)
{

} */
HRESULT hr = Copy(pIn, pOut);//将输入缓冲区输入拷贝到输出缓冲区,执行时间大约2ms
if (FAILED(hr))
return hr;
return Transform(pOut);//对输出缓冲区的数据进行自定义变换

}
the code above is Transform() function which has been override.The truth is if Transform(Pout) costs 10ms,the frame rate will be 1000/(33.3+10)fps.PS:my camera provides 1920*1080 video at 30fps

1 solution

You have "transform" time and "render" time.

And FPS is a function of the overall CPU load and GPU "capability".

Then there is "single-pass" versus "double-pass" rendering...

FPS is not "science"; it's a balancing act.
 
Share this answer
 

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