<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="edo-message">
<div></div>
You don't need to enable codecs explicitly when you build ffmpeg unless you want to exclude everything else. Just do a build without any of the enable/disable flags and it will include most of the codecs and muxers by default. </div>
<div id="edo-message"><br>
</div>
<div id="edo-message">I think you're a little confused on the terminology. </div>
<div id="edo-message"><br>
</div>
<div id="edo-message">First off "mov" is part of the "mp4" demuxer. It's a slight variation of mp4 tha was developed by Apple before mp4 existed. It's actually what the mp4 specification was built from.</div>
<div id="edo-message"><br>
</div>
<div id="edo-message">Secondly the MPEG-4 spec actually contains two video codecs. MPEG-4 part 2 is the older one that Divx and Xvid were based on. MPEG-4 part 10 is H.264 (aka AVC) and is what most people think of these days when you say MPEG-4.</div>
<div id="edo-message"><br>
</div>
<div id="edo-message">In avlib the MP4 demuxer is "mp4". The MPEG-4 part 2 decoder is "mpeg4", the H.264 decoder is "h264". </div>
<div id="edo-message"><br>
</div>
<div id="edo-message">A little trick for finding the right name. Look for the code file that you're trying to use, like h264dec.c for H.264 decoder, then scroll all the way to the bottom. There is a little constructor class and one of the variables is the .name
which is what you're looking for. </div>
<div id="edo-message"><br>
</div>
<div id="edo-message">Good luck,</div>
<div id="edo-message">Dan</div>
<div id="edo-meta"></div>
<div id="edo-original">
<div><br>
<br>
<blockquote type="cite" style="margin:1ex 0 0 0;border-left:1px #ccc solid;padding-left:0.5ex;">
<div>On Nov 9, 2017 at 9:38 AM, <<a href="mailto:explomaster@gmail.com">Michael IV</a>> wrote:<br>
<br>
</div>
<div>
<div dir="ltr">But now I see in vlc that the MPEG4 codec is actually named "mp4v" .So that's the name I have to specificy in --enable-decoder when doing FFMPEG config?
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 9, 2017 at 7:26 PM, Michael IV <span dir="ltr">
<<a href="mailto:explomaster@gmail.com" target="_blank">explomaster@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">And testing the actual codecId of the video stream in the file I am also getting NULL for avcodec_find_decoder:
<div><br>
</div>
<div>
<div> ret = av_find_best_stream(<wbr>pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);</div>
<div><span style="white-space:pre-wrap"></span>st = pFormatCtx->streams[ret];</div>
<div><span style="white-space:pre-wrap"></span>AVCodecContext *dec_ctx = NULL;</div>
<div><span style="white-space:pre-wrap"></span>AVCodec *dec = NULL;</div>
<div><span style="white-space:pre-wrap"></span>dec_ctx = st->codec;</div>
<div><span style="white-space:pre-wrap"></span>dec = avcodec_find_decoder(dec_ctx-><wbr>codec_id);</div>
</div>
<div><br>
</div>
<div> <b> where ec_ctx->codec_id == AV_CODEC_ID_MPEG4</b></div>
</div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 9, 2017 at 7:22 PM, Michael IV <span dir="ltr">
<<a href="mailto:explomaster@gmail.com" target="_blank">explomaster@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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-wrap"></span>AVDictionary *d = NULL; </div>
<div><span style="white-space:pre-wrap"></span>av_dict_set(&d, "protocol_whitelist","file", 0); //ok<br>
</div>
<div> int ret = avformat_open_input(&pFormatCt<wbr>x, in_f_name , NULL, &d); //ok<br>
</div>
</div>
<div> avformat_find_stream_info(pFo<wbr>rmatCtx, 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]->codecp<wbr>ar->codec_type==AVMEDIA_TYPE_<wbr>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>
<div class="m_1235953485649798123h5">
<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="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Flibav-user&data=02%7C01%7Cdan6992%40hotmail.com%7Cfb6faa38f00548ee8fc108d52798a8a9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636458458994105842&sdata=o6jGGddtpys4%2Bnt6m8wvQx3RNDzVptAvSyQojdIlR5g%3D&reserved=0" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/list<wbr>info/libav-user</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>