- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using intel IPP libraries for decoding H264 video stream. Video streams in 30 FPS with 1280 x 780 resolution.
For decoding one H264 video channel, the decoderprogramtakes around 30 - 40 % of CPU usage.
Even after calling the
ippStaticInit();
and below is the code snippet which i used for decoding H264 video stream data. Please let me know if i am missing anything in my code which consumes more CPU.
Ipp8u *cVideoData; // Contains the pointer to compressed video frame
Ipp8u *cRGBData; // Buffer allocated for decompressed RGB image
int RGBimgWidth = 1280;
int RGBimgHeight = 780;
int VideoDataSize; // datasize of compressed image
UMC::Status status = UMC::UMC_OK;
UMC::MediaData DataIn;
UMC::VideoDecoderParams Params;
DataIn.SetBufferPointer(cVideoData,VideoDataSize);
DataIn.SetDataSize(VideoDataSize);
Params.m_pData = &DataIn;
Params.lFlags=0;
Params.numThreads=1;
if(!m_bdecInit && status = pH264Decoder->Init(&Params)!=UMC::UMC_OK)
{
return false;
}
m_bdecInit = true;
DataOut.Init(RGBimgWidth,RGBimgHeight,UMC::RGB24,8);
DataOut.SetBufferPointer(cRGBData,RGBimgWidth*RGBimgHeight*3);
status = pH264Decoder->GetFrame(&DataIn, &DataOut);
if (status == UMC::UMC_OK)
{
pH264Decoder->GetInfo(&Params);
RGBimgWidth = Params.info.clip_info.width;
RGBimgHeight = Params.info.clip_info.height;
}
else
{
status = pH264Decoder->GetFrame(NULL, &DataOut);
if (status != UMC::UMC_OK)
{
return false;
}
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have given the specification about the processor below,
Intel Core2 duo CPU P8400 @ 2.26GHZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code specify to use only one threading:
...
Params.numThreads=1;
...
It is better set the threading number to phsical CPU core number.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still same problem with CPU consumption. Please let me know if you require more details.
Correctme if i am setting any wrong values or if i am using anything wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which compiler are you using to compile the sample application? H.264 is threaded with OpenMP. It requires the compiler to support OpenMP ( Intel C++, Visual C++ 2008, etc).
If this also looks fine, you can attach a bitstream, so we can have a check.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note that in term of comparison, with multi thread support disabled I can decode 720p/30fps/1.5mbps baseline using a small fraction <30% (depending of the complexity of the stream) of one core of an I7 2.66Ghz system.
I think 30%-40% of a core 2 duo 2.44 might be what you get.
(note that color conversion to RGB24 is enabled which consume a little extra CPU).
Emmanuel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Emmanuel and scorpuva,
This has two questions here:
1) If the decoder tries to decode as faster as possible, what is CPU usage here, what is the max frame rate it can get?
I just tried the attached SampleVideo.264 file with UMC umc_h264_dec_con sample application. It almost reached the 100% CPU usage. I test at my laptop with Core 2 Duo T7300, 2.0G, and the frame rate is about 90fps.
2)If application code only wants to maintain about 30fps, what is CPU usage will be enough.
I agree with Emmanuel. 30%-40% usage of a core 2 duo 2.44 might be enough for decoding the attached video file.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The video streams in the frame rate of 30 FPS from the h264 encoder with the bitrate of 3mbps. Currently it takes around 30 - 40 percent.
I tested the same video stream withVLC player which takes around 15 - 20 percent. Both the VLC and My decompression module are using the RTSP connection with the h264 encoder. How does VLC can decode the same video stream with cpu usage of 15- 20 %?. How to make the IPP decoder to consume cpu below
20 %?
regards,
uva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page