I am working with FFmpeg Lib, and I get a warning, my code as below:
if ( avformat_find_stream_info( pFormatCtx, NULL ) < 0 ) {
std::cout << "Get Stream Information Error 13" << std::endl;
avformat_close_input( &pFormatCtx );
pFormatCtx = NULL;
return -13;
}
av_dump_format( pFormatCtx, 0, filenameSrc, 0 );
for ( unsigned int i = 0; i < pFormatCtx->nb_streams; i++ ) {
if (pFormatCtx->streams[i]->codec->coder_type == AVMEDIA_TYPE_VIDEO) {
video_stream_index = i;
break;
}
}
And I meet the warning at line: pFormatCtx->streams[i]->codec->coder_type == AVMEDIA_TYPE_VIDEO
Warning: AVCodecContext::coder_type’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:2815) [-Wdeprecated-declarations]
I dont understand what does this warning mean and how to resolve it.
Anyone can help me !
Thank
Try to use codec_type
from codecpar
:
if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
video_stream_index = i;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With