Hi,<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><div>avcodec_open() is returning -1 when I try to open the MJPEG 
encoder. However, avcodec_open() succeeds when creating the MPEG-4 
encoder with the same context settings.</div></blockquote>MJPEG works with full-range YUV formats that named as  PIX_FMT_YUVJ420P,  PIX_FMT_YUVJ422P.<br>Developers say that these formats are deprecated and special range flag should be used instead of dedicated pixel formats<br>
but I'm not sure that this is already done.<br><br>Most other codecs (like MPEG4) works with <span id="result_box" class="short_text" lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод" class="hps">compressed-range YUV formats like </span></span>PIX_FMT_YUV420P<span id="result_box" class="short_text" lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод" class="hps">.</span></span><br>
Thats why your code probably wrong. By the way FFmpeg often show error description in console output.<br><span style="color:rgb(192, 192, 192)">-----------------------------------------------</span><br style="color:rgb(192, 192, 192)">
<span style="color:rgb(192, 192, 192)">Kirill Gavrilov,</span><br style="color:rgb(192, 192, 192)"><span style="color:rgb(192, 192, 192)">Software designer.</span><br><a href="mailto:kirill@sview.ru" target="_blank"></a><br>