Community
cancel
Showing results for 
Search instead for 
Did you mean: 
manca1
Beginner
17 Views

GetFrame always returns -996

Hi there,
I've been stuck with this IPP h264 decoder for a week now. I tried everything to make it decode some data, but it simply refuses to work! I tried implementing IPP MP4 Splitter and getting data from the valid H264 stream (mp4 video file) and then passing data to decoder so that I can render the video or simply write it to file. GetFrame() always returned -996, even though the data was valid and there.

Please let me know if you have some ideas why this don't work. Here's the code (it's basically the splitter sample you have on the site):
	vm_string_strcpy(readerParams.m_file_name, inputfilename);
	if((status = reader.Init(&readerParams))!= UMC::UMC_OK) 
       return;
	splitterParams.m_lFlags = UMC::VIDEO_SPLITTER;
	splitterParams.m_pDataReader = &reader;
    if((status = Splitter.Init(splitterParams))!= UMC::UMC_OK)
	   return;
	Splitter.GetInfo(&streamInfo);
    for (videoTrack = 0; videoTrack <  streamInfo->m_nOfTracks; videoTrack++) {
      if (streamInfo->m_ppTrackInfo[videoTrack]->m_Type == UMC::TRACK_H264)
           break;
    }
	videoInfo = (UMC::VideoStreamInfo*)(streamInfo->m_ppTrackInfo[videoTrack]->m_pStreamInfo);
	if(videoInfo->stream_type!=UMC::H264_VIDEO)
        return;
    videoDecParams.info =  (*videoInfo);
	videoDecParams.m_pData = streamInfo->m_ppTrackInfo[videoTrack]->m_pDecSpecInfo;
	videoDecParams.numThreads = 1;
    videoDecoder = (UMC::VideoDecoder*)(new UMC::H264VideoDecoder());
	if((status = videoDecoder->Init(&videoDecParams))!= UMC::UMC_OK)
		return;

	fwRenderParams.out_data_template.Init(videoInfo->clip_info.width, videoInfo->clip_info.height, videoInfo->color_format);
	fwRenderParams.pOutFile = outputfilename;

	if(status = fwRender.Init(&fwRenderParams)!= UMC::UMC_OK)
		return;

	Splitter.Run();
	do
	{   do{ 
		     if (in.GetDataSize() < 4) {
	    	     do{ 
	              status= Splitter.GetNextData(&in,videoTrack);
			       if(status==UMC::UMC_ERR_NOT_ENOUGH_DATA)
   			            vm_time_sleep(5);
			      }while(status==UMC::UMC_ERR_NOT_ENOUGH_DATA);
			      if(((status != UMC::UMC_OK) && (status != UMC::UMC_ERR_END_OF_STREAM))||
				     (status == UMC::UMC_ERR_END_OF_STREAM)&& (in.GetDataSize()<4)) {
                        exit_flag=1;
				  }
             }
			 fwRender.LockInputBuffer(&out);
		     status = videoDecoder->GetFrame(&in,&out);
    	  	 fwRender.UnLockInputBuffer(&out);
		     fwRender.RenderFrame();
	     }while(!exit_flag && (status == UMC::UMC_ERR_NOT_ENOUGH_DATA || status == UMC::UMC_ERR_SYNC));
	 }while (exit_flag!=1);

	 do{  
		 fwRender.LockInputBuffer(&out);
	     status  = videoDecoder->GetFrame(NULL,&out);
	     fwRender.UnLockInputBuffer(&out);
         fwRender.RenderFrame();
	}while(status == UMC::UMC_OK);	

I am using IPP v7 libraries. And the sample file I'm trying to decode is valid .mp4 with h264 video and aac audio.

Thanks in advance.

0 Kudos
2 Replies
Ying_H_Intel
Employee
17 Views

Hi Manca1,

Could you attached the mp4 file? Or Have you tried the sample file with the simple_player.exe? which is supposed be abletodecode the h264 video and aac audio too. Can it decode/play the stream?

Best Regards,
Ying H.
manca1
Beginner
17 Views

Hey Ying,
Actuallty I couldn't run sample_player.exe. I complied it along with all the libs it uses, but it won't run. Gives me some weird error than no manifest or something like that doesn't exist. The code I have in my sample is basically identically to the one sample_player uses. So I guess it won't be able to decode my sample as well.
See attached file for the mp4 I'm trying to decode.
Thanks a lot!