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

problem to use SDK functionality

stsybikov
Beginner
269 Views

Hi,

Sorry if I created the thread in wrong forum. I don't know where address my issue to.

I have the following problem using Intel media SDK.
Several months ago I downloaded the trial version of Intel Parallel Studio to do the evaluation. I was able to encode YUV 420 video stream to h264, mpeg2 and mpeg4 video files. Also I was able to mux them as well. Several times I did extension of Studio trial version. When all periods expired I was unable to do the encoding. No target files had been created.

Finally the company bought the official version of Intel Parallel Studio XE 2011 for Windows. I took a fresh copy of Windows XP and installed Microsoft Visual Studio 2010 and Parallel Studio. Finally I was able to compile my code. When I run my part I got the same result as with expired trial version.

The problem is here:
UMC::FileWriter writer;
UMC::FileWriterParams params;
...
writer.Init(&params);

Init() call returns UMC::OK but the file physically is not created. Initially when I used trial version during this call file is created normally with 0 kb size.

Does anyone have the idea what the problem could be?

Thanks in advance

Sergey Tsybikov

Smith&Nephew

0 Kudos
2 Replies
Tamer_Assad
Innovator
269 Views

Hi Sergey,

UMCs are sample classes shipped with IPP, not Intel Media SDK.

Regarding the UMC::FileWriter object, you should associate it with a UMC::Muxer object; please post a code sample to clarify the problem.

Regards,

Tamer Assad

0 Kudos
stsybikov
Beginner
269 Views
Hi, Tamer;

You are right. This is IPP.
This is extraction from my code. I tried to do it more simple.



UMC::FileWriter Writer;
UMC::FileWriterParams WriterParams;
wcscpy_s(WriterParams.m_file_name, _T("C:\\target.mpg"));

UMC::Status status;
if((status = Writer.Init(&WriterParams)) != UMC::UMC_OK)
return;

UMC::VideoStreamInfo VideoInfo;
memset(&VideoInfo, 0, sizeof(VideoInfo));
VideoInfo.streamPID = 0;
VideoInfo.stream_type = UMC::MPEG2_VIDEO;
VideoInfo.color_format = UMC::YUV420;
VideoInfo.interlace_type = UMC::PROGRESSIVE;
VideoInfo.aspect_ratio_height = 9;
VideoInfo.aspect_ratio_width = 16;
VideoInfo.clip_info.height = 1080;
VideoInfo.clip_info.width = 1920;
VideoInfo.bitrate = 100000000;
VideoInfo.framerate = 24;

UMC::MPEG2MuxerParams MuxerParams;
MuxerParams.m_lpDataWriter = &Writer;
MuxerParams.m_SystemType = UMC::MPEG2_PURE_VIDEO_STREAM;
MuxerParams.m_nNumberOfTracks = 1;

MuxerParams.pTrackParams = new UMC::TrackParams[MuxerParams.m_nNumberOfTracks];
MuxerParams.pTrackParams[0].type = UMC::VIDEO_TRACK;
MuxerParams.pTrackParams[0].info.video = &VideoInfo;
MuxerParams.pTrackParams[0].bufferParams.m_prefInputBufferSize = 2000000;
MuxerParams.pTrackParams[0].bufferParams.m_prefOutputBufferSize = 2000000;

UMC::MPEG2Muxer Muxer;
if((status = Muxer.Init(&MuxerParams)) != UMC::UMC_OK)
return;

UMC::MPEG2EncoderParams videoParams;
videoParams.info.clip_info.height = 1080;
videoParams.info.clip_info.width = 1920;
videoParams.info.bitrate = 10000000;
videoParams.info.color_format = UMC::YUV420;
videoParams.info.framerate = 24;
videoParams.info.stream_type = UMC::MPEG2_VIDEO;
videoParams.info.aspect_ratio_height = 9;
videoParams.info.aspect_ratio_width = 16;
videoParams.numThreads = 1;

UMC::MPEG2VideoEncoder Mpeg2Encoder;
if((status = Mpeg2Encoder.Init(&videoParams)) != UMC::UMC_OK)
return;

UMC::VideoData DataVideoIn;
if((status = DataVideoIn.Init( pReader->m_pVideoStruct->nFrameWidth, pReader->m_pVideoStruct->nFrameHeight, UMC::YUV420,8)) != UMC::UMC_OK)
return;

Ipp8u* pOutputVideoData = ippsMalloc_8u(3110400); // video frame buffer

while(bRun)
{
DataVideoIn.SetBufferPointer(pVideoFrameBuffer, 3110400);
DataVideoIn.SetDataSize(pReader->m_nVideoBufferSize);

DataVideoOut.SetBufferPointer(pOutputVideoData, 100000000);

status = Mpeg2Encoder.GetFrame(&DataVideoIn, &DataVideoOut);
if (status == UMC::UMC_OK)
{
nEncodedVideoFrames++;

int nDataSize = DataVideoOut.GetDataSize();
MuxVideoData.SetBufferPointer(pOutputVideoData, nDataSize);

memcpy(MuxVideoData.GetDataPointer(), DataVideoOut.GetDataPointer(), nDataSize);

MuxVideoData.SetDataSize(nDataSize);
MuxVideoData.SetTime(nEncodedVideoFrames*((double)1.0)/24);

do
{
status = Muxer.PutVideoData(&MuxVideoData);
if (UMC::UMC_ERR_NOT_ENOUGH_BUFFER == status)
vm_time_sleep(5);
}while (UMC::UMC_ERR_NOT_ENOUGH_BUFFER == status);
}
}


Regards,
Sergey Tsybikov
0 Kudos
Reply