Hi all:
I can use cmd "./moduletest.out alg_vidDec" to decode a h.264 file well,
now I modify the ALG_vidDecTestMain function to build my own h.264 decoder function for real time stream,
but the output video is not good, it will have some Remnant shade and wrongcolor when video is moving,
it only look better in static video, so I guess, it maybe get wrong input data for decoder,
Now, I can get h.264 data from openRTSP,
step 1- 00 00 00 01 67 ...
step 2- 00 00 00 01 68 ...
step 3- 00 00 00 01 65 ...
step 4 - 00 00 00 01 61 ...
step 5- 00 00 00 01 61 ...
I will get 00 00 00 01 61 (like step 4 and 5) about 29 times and then return to step 1 for a cycle.
My input data is as follow
step 1 input data - 00 00 00 01 67 ... 00 00 00 01 68 ... 00 00 00 01 65 at first time (size about 5xxxx )
step 2. input data - 00 00 00 01 61 ... (size about 1xxxx)
step 3 input data - 00 00 00 01 61 ... (size about 1xxxx)
the data of 00 00 00 01 61 will be 29 times and then return step 1 for a cycle
can I input the above data style to decoder?
My function code is as follow
////////////////////////////////////////////////////
totalDecSize = 0;
bufId=0;
count=0;
whOffset = 96;
decodeId=0;
//while(totalDecSize < fbuff_size) { // I mask the while loop and every data input to decoder only one time
decPrm.inAddr = curInAddr;
decPrm.outAddr = outVirtAddr[bufId];
decPrm.inDataSize = 100*KB;
decPrm.outOffsetH = OSA_align(720+whOffset, 32); //My resolution is D1
decPrm.outOffsetV = 480+whOffset; //My resolution is D1
decPrm.inputBufId = bufId;
OSA_prfBegin(&gAVSERVER_ctrl.decodePrf[decodeId]);
status = ALG_vidDecRun(gVIDEO_ctrl.decodeStream[decodeId].algDecHndl, &decPrm, &decStatus);
OSA_prfEnd(&gAVSERVER_ctrl.decodePrf[decodeId], 1);
if(status==OSA_SOK) {
/ /OSA_printf(" ALG: VidDec: ALG_vidDecRun() : OK \n");
// curInAddr += decStatus.bytesUsed;
// totalDecSize += decStatus.bytesUsed;
} else {
OSA_printf(" ALG: VidDec: ALG_vidDecRun() ERROR !!!\n");
// break;
}
/* bufId ^= 1;
count++;
if(count>10000)
break;*/
ALG_vidDecDisplayCopy(
outVirtAddr[decStatus.outputBufId],
outPhysAddr[decStatus.outputBufId],
&decStatus);
///////////////////////////////////////////////////////////////////////////////////////////
Can anyone give me some advise? Thanks a lot.