<div dir="ltr"><div dir="auto">Hi, thanks for the input. Now I am confused even more. All  I need is to start demuxing an mp4 file. Those codecs test above is not what I do.</div><div>I started to check those because I am getting into trouble in this part:</div><div><br></div><div><div>        pFormatCtx = avformat_alloc_context();  //ok</div><div><span style="white-space:pre">  </span>AVDictionary *d = NULL; </div><div><span style="white-space:pre">     </span>av_dict_set(&d, "protocol_whitelist","file", 0);  //ok<br></div><div>        int ret = avformat_open_input(&pFormatCtx, in_f_name , NULL, &d);  //ok<br></div></div><div>         avformat_find_stream_info(pFormatCtx, NULL) ///also ok</div><div><br></div><div>But once I get to access the codecpar I hit  "access violation reading location:</div><div><br></div><div><b>pFormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO</b><br></div><div><br></div><div>Because my <b>codecpar </b>is not initialized. That's what I don't understand here.</div><div><br></div><div><br></div><div><br></div><div dir="auto"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Nov 9, 2017 8:14 PM, "Carl Eugen Hoyos" <<a href="mailto:ceffmpeg@gmail.com" target="_blank">ceffmpeg@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
> Am 09.11.2017 um 17:13 schrieb Michael IV <<a href="mailto:explomaster@gmail.com" target="_blank">explomaster@gmail.com</a>>:<br>
><br>
> Hi All. What maybe a reason that  avcodec_find_decoder returns NULL ?<br>
><br>
> I enabled in my FFMPEG build MOV and h264 demuxer. Configure report clearly<br>
> states that.<br>
><br>
> But doing this test:<br>
><br>
>          av_register_all();<br>
>        avcodec_register_all();<br>
>          avformat_network_init();<br>
>          AVCodec* h264codc = avcodec_find_decoder_by_name("<wbr>h264");<br>
<br>
This is supposed to work.<br>
<br>
<br>
>        AVCodec* h264codc1 = avcodec_find_decoder_by_name("<wbr>MOV");<br>
<br>
This is not the name of any decoder, mov is a file format, you will find a demuxer (and a muxer) with that name (I think).<br>
<br>
>        AVCodec* h264codc3 = avcodec_find_decoder_by_name("<wbr>MPEG4");<br>
<br>
There is codec "mpeg4" but that's not h264.<br>
<br>
>        AVCodec* h264codc4 = avcodec_find_decoder_by_name("<wbr>MP4");<br>
<br>
See above for mov, although the same demuxer handles mov and mp4.<br>
<br>
>        AVCodec* h264codc5 = avcodec_find_decoder(AV_CODEC_<wbr>ID_MPEG4);<br>
<br>
Again, this codec exists but it's not h264.<br>
<br>
> Only h264codc  returns a valid codec.<br>
<br>
<br>
> The only thing I didn't do during build config was not to enable libx264.<br>
<br>
This only means that you have no h264 encoder.<br>
<br>
> May this be the source of the problem? I didn't do that because I just need to demux  mp4 movie and get its elementary stream.<br>
<br>
Then you don't care about a decoder, you only need a demuxer (and maybe a parser).<br>
<br>
Carl Eugen<br>
______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
</blockquote></div></div>
</div>