[Libav-user] regarding libavcodec method - av_parser_parse2 usage

Shiju Sasi sasishiju at gmail.com
Fri Mar 2 12:32:23 CET 2012


Hi,

I have a multi threaded video application using x264 and ffmpeg. In the
decoding flow, I have a question on av_parser_parse2.

I use it as below.

int len = 0;

len =
av_parser_parse2(m_pDecoderParserContext,m_pCodecCtx,&avpkt.data,&avpkt.size,in_buf,
in_buf_size,0,0,0);



Here I get the return value len = in_buf_size. But the avpkt.data is not
getting filled in. It gets zero, so is the avpkt.size

To check if the error is due to the usage of AVPacket, I changed it to



uint8_t* pOutBuf = new uint8_t[50000];

memset(pOutBuf,5,50000);

int iOutSize = 100;

len =
av_parser_parse2(m_pDecoderParserContext,m_pCodecCtx,&pOutBuf,&iOutSize_buf,
in_buf_size,0,0,0);


Here, av_parser_parse2 changed the '5' returned to all the pOutBuf
locations to zero and the output size varable also got set as 0.  I tried a
uint8_t pointer without any memory allocated as well.

Nothing gives me  a valid output pointer, but in all cases, the parsing
happens for the entire input variable ( as indicated by the return value of
the function).

Could any of you please give me more information on this?

Thanks in advance,
Shiju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120302/aa476574/attachment.html>


More information about the Libav-user mailing list