Home > other >  WPF real-time preview video CPU occupancy rate is too high
WPF real-time preview video CPU occupancy rate is too high

Time:09-26

Experts: have a question want to ask, I have a few WPF interface real-time preview hikvision camera interface,
I make out of the window of the camera play a UserControl,
When loading two real-time preview window 50% CPU utilization rate is high,
The front desk writing:



The background of writing:
CHCNetSDK.NET _DVR_PREVIEWINFO lpPreviewInfo=new CHCNetSDK.NET _DVR_PREVIEWINFO ();
LpPreviewInfo. HPlayWnd=
RealPlayWnd. Handle;//the preview window
LpPreviewInfo. LChannel=1;//te of preforms channel
LpPreviewInfo. DwStreamType=0;//code flow type: 0 - the main stream, 1 - stream, 3, 3-2 - stream stream 4, and so on
LpPreviewInfo. DwLinkMode=0;//connection mode: 0 - TCP, 1 - UDP way, 2 - multicast way, 3 - RTP, 4 - RTP/RTSP, 5 - RSTP/HTTP
LpPreviewInfo. BBlocked=true;//0 - a non-blocking stream, 1 - to take flow
LpPreviewInfo. DwDisplayBufNum=15;//play library playout buffer buffer biggest frames

CHCNetSDK. REALDATACALLBACK RealData=https://bbs.csdn.net/topics/new CHCNetSDK. REALDATACALLBACK (REALDATACALLBACK);//preview real-time flow callback function
IntPtr pUser=new IntPtr ();//user data

//open the preview Start live view
M_lRealHandle=CHCNetSDK.NET _DVR_RealPlay_V40 (m_lUserID, ref lpPreviewInfo, null RealData *//* and pUser);

Excuse me each expert what's the deal?

CodePudding user response:

Hi,
The WPF animation, data binding, the layout of the complex, rendering... And your background complex calculations, these can lead to high CPU,
If is only a preview picture, why use Winform controls, WPF Image can't meet the requirements?
In addition, have you ever run programs on performance better machines?
I suggest that you try to use the CPU analysis tool for your application,
Sincerely,
Bob

CodePudding user response:

Hi,
The WPF animation, data binding, the layout of the complex, rendering... And your background complex calculations, these can lead to high CPU,
If is only a preview picture, why use Winform controls, WPF Image can't meet the requirements?
In addition, have you ever run programs on performance better machines?
I suggest that you try to use the CPU analysis tool for your application,
Sincerely,
Bob

CodePudding user response:

Hi,
WPF Image is no handle, hikvision real-time preview video SDK is to control the handle,
Is there any way to get a handle

CodePudding user response:


Hi,
WPF Image is no handle, hikvision real-time preview video SDK is to control the handle,
Is there any way to access to handle you

Is a kind of video decoding this is complete, with win32 as a DLL or exe, embedded in WPF interface
And one is from the SDK code flow back out after their processing and then through the MEDIA of WPF or image display, this I didn't try, theoretically possible

CodePudding user response:

I also encountered such a problem, you later how to solve?
  • Related