AnsweredAssumed Answered

about lags of VCE h264 encoder

Question asked by chenhua on Sep 28, 2015
Latest reply on Oct 2, 2015 by chenhua

I want to develop a remote gaming application using Media sdk. So i  transformed the dem project in vce sample into a live caputre&encoded program. The program was running on Windows 7, the remote part was a pc and running mplayer to display the 264 stream.

After some testing,  i found some problems:

 

1. sometimes the stream stalled for about several handred of micro seconds. function mEncoder->GetNextFrame(&buffer) took above 500ms. so we can seem apparently stalled picture for a while。

2. the image captued has lags behind display.

 

The configurate was as follow:

 

//pconfig->usage = 4;   //low latency
    pconfig->usage = 2;   //wireless display
    pconfig->outputType = 3;   //for 264
    //pconfig->outputType = 2;   //for ts

    //pconfig->profile = 66;

    pconfig->profile = 100;

    pconfig->framesToEncode = 1000000;

 

    pconfig->width = 1920;

    pconfig->height = 1080;

 

    pconfig->bitRate = 20000000;

    pconfig->peakBitRate = 20000000;

 

    pconfig->idrPeriod = 6000;

    //pconfig->idrPeriod = 0;

    //pconfig->skippedPicPeriod = 1;

    pconfig->skippedPicPeriod = 0;

    pconfig->slicesPerFrame = 32;

 

    pconfig->intraRefreshMBperSlot = 360;

    //pconfig->intraRefreshMBperSlot = 0;

    pconfig->initialVBVbuffFullness = 0;

 

    pconfig->vbvBuffSize = 312500;

    pconfig->minQP = 0;

    pconfig->maxQP = 5;

 

I also tried usage = 4 with no difference.

 

Is that config correct? how to eliminate the lag?

Thanks!

Outcomes