[Libav-user] avcodec_find_decoder is always null
keren happuch
christkeren at gmail.com
Fri Feb 7 10:28:20 CET 2014
Hi,
Im trying to execute a example program given in ffmpeg folder ,
*1.1. Register all formats and codecs*
av_register_all();
avcodec_register_all();
avformat_network_init();
works fine
*1.2. Open video file*
char *drone_addr = "http://192.168.1.1:5555";
AVFormatContext *pFormatCtx = NULL;
while(avformat_open_input(&pFormatCtx, drone_addr, NULL, NULL) != 0)
printf("Could not open the video file\nRetrying...\n");
works fine
*1.3. Display information*
// Retrieve stream information
avformat_find_stream_info(pFormatCtx, NULL);
// Dump information to standard output
av_dump_format(pFormatCtx, 0, drone_addr, 0);
works fine
*1.4. Find decoder *
// Get a pointer to the codec context for the video stream
// and find the decoder for the video stream
AVCodecContext *pCodecCtx;
AVCodec *pCodec;
pCodecCtx = pFormatCtx->streams[0]->codec;
pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
the condition fails.. avcodec_find_decoder always fails.. any help Thanks
in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140207/186a59be/attachment.html>
More information about the Libav-user
mailing list