Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

H.264 decoder and HD video poor quality

bcisrd
Beginner
355 Views

I have developed a RTSP based program that connect to a IP camera and I use UMC::H264VideoDecoder to decode the video stream. I am getting different results based on the video Ratio and I'm hoping someone can help me understand steps I can take to correct the problem.

It seems Video that is 800x600 or smaller does not have an issue regardless of quality, but when the image is larger for instance 1280x720 the video gets 'jerky' and as a person walks across the frame their image will trail behind them. This is not a constant problem, but happens enough to indicate I am doing something wrong. Are there special considerations required for H264VideoDecoder when dealing with large video images?

The same video image can be viewed from a web base page provided by the camera and the image does is smooth and good quaility.

IPP version 7.0.4.196
IPP samples version 7.0.4.054
Windows 7 Professional
Processor Intel Core i5-2400S CPU @ 2.50GHz and 4 GB Ram
32 - bit Operating System
Compiled using Visual Studio 2008 using C++

Below is example code of how I initiate and decode the video stream.

//--------------------------------------------------------------------------------
// pData is an array having SPS and FPS parameters
//--------------------------------------------------------------------------------
bool Init (BYTE *pData, unsigned long nSize, int &nWidth, int &nHeight)
{
bool bRetVal = false;
UMC::Status nStatus;
UMC::VideoDecoderParams VidDecodeParams;
m_pvidDecoder = new UMC::H264VideoDecoder();
if (m_pvidDecoder)
{
m_inVid.SetBufferPointer (pData, nSize);
m_inVid.SetDataSize (nSize);
VidDecodeParams.pPostProcessing = NULL;
VidDecodeParams.info.stream_type = UMC::H264_VIDEO;
VidDecodeParams.numThreads = 1;
VidDecodeParams.lFlags = 0;
VidDecodeParams.m_pData = &m_inVid;
nStatus = m_pvidDecoder->Init(&VidDecodeParams);
if(nStatus == UMC::UMC_OK)
{
UMC::H264VideoDecoderParams params;
nStatus = m_pvidDecoder->GetInfo (&params);
if(nStatus == UMC::UMC_OK)
{
nWidth = params.info.clip_info.width;
nHeight = params.info.clip_info.height;
nStatus = m_outVid.Init (nWidth, nHeight, UMC::YUY2, 8);
if(nStatus == UMC::UMC_OK)
{
nStatus = m_outVid.Alloc ();
if(nStatus == UMC::UMC_OK)
bRetVal = true;
}
}
}
}
return (bRetVal);
}

//--------------------------------------------------------------------------------------------
// ppDecFrm is a BYTE array whose size is (Width * Height * 2)
// pData is a NAL array reconstructed from FU-A packets from the IP camera
//--------------------------------------------------------------------------------------------
bool DecodeFrame (BYTE *pData, UINT &nSize, BYTE **ppDecFrm, UINT nFrmSize)
{
UMC::Status nStatus;
bool bRetVal = false;
UMC::VideoData outVid;
m_outVid.Reset ();
m_inVid.Reset ();
m_inVid.SetBufferPointer (pData, nSize);
m_inVid.SetDataSize (nSize);
nStatus = m_pvidDecoder->GetFrame(&m_inVid, &m_outVid);
if(nStatus == UMC::UMC_OK)
{
unsigned long nDecSize = (unsigned long)m_outVid.GetDataSize ();
if(nDecSize > 0)
{
memcpy_s((*ppDecFrm), nFrmSize, m_outVid.GetDataPointer (), nDecSize);
nSize = nDecSize;
bRetVal = true;
}
}
return (bRetVal);
}

0 Kudos
4 Replies
bcisrd
Beginner
355 Views
This problem seems to be specific to my machine.

Windows 7 Professional
Intel Core i5-2400s CPU @ 2.50GHz
4.00 GB Ram (2.94 GB usable)

I tested on a second machine and did not see the problem
Windows 7 Professional
Intel Core 2Duo CPU @ 3.00GHz
2.00 GB Ram

Any suggestions?


0 Kudos
Chao_Y_Intel
Moderator
355 Views

Hello,

Is it possible to dump some video, and decoded by the decoder? It will be help to identify if this is decoder problem, or some others.

Thanks,
Chao

0 Kudos
bcisrd
Beginner
355 Views

I am working on it and will update soon.

0 Kudos
bcisrd
Beginner
355 Views
We have 2 different machines in house that I can test with (multiples of each).

Intel Core i5-2400S CPU @ 2.50GHzwith 4 GB Ram
with a Intel 82579LM Gigabit Network (Driver Version 11.12.36.0)

Intel Core 2Duo CPU @ 3.00GHz with 2 GB Ram
witha Intel 82567LM-3 Gigabit Network (Driver Version 11.5.10.0)

The ghosting issue only appears on the i5-2400S machines.
Just to note, VLC has the same issue (i.e. no issue on 2Duo and ghosting issue on i5-2400S).

I wrote atest program which writes packets to a file as soon asit reads it off of the socket, and an accompying test program that will read in the data file and play the video (No network connection).

Usingdata captured from i5-2400S and play it on a 2DUothe ghosting issue does occur.And, the reverse, captured data from 2DUo and playing it on the i5-2400S, itdoes not have the ghosting issue. Just to reiterate,making a rtsp connection ona i5-2400Shas a ghostingissue, where a rtsp connection on a 2Duo does not have the issue.I beleive the internal buffer is some how getting corrupted.

0 Kudos
Reply