ffmpeg开发视频时avcodec_decode_video总返回-1?
基本开发流程:
avcodec_init(); av_register_all(); pCodec=avcodec_find_decoder(CODEC_ID_H264); pCodecCtx= avcodec_alloc_context(); if(pCodec==NULL) { return; } //为对应的流打开所需要的编码器 if(avcodec_open(pCodecCtx, pCodec)<0) { return; } //分配AVFrame空间 if(pFrame==NULL) { pFrame=avcodec_alloc_frame(); }......... int n=avcodec_decode_video(pCodecCtx,pFrame,&frameFinished,(unsigned char *)inBuf,inBuf_length);//n总为-1?