<div dir="ltr">Hello everyone,<div><br></div><div>I am trying to encode an .mkv file from jpeg images. Opening the codec with avcodec_open2 fails with the following error:</div><div><br></div><div>
<p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">[libx264 @ 0x7fffb8003200] broken ffmpeg default settings detected</span></p>
<p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">[libx264 @ 0x7fffb8003200] use an encoding preset (e.g. -vpre medium)</span></p>
<p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">[libx264 @ 0x7fffb8003200] preset usage: -vpre <speed> -vpre <profile></span></p>
<p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">[libx264 @ 0x7fffb8003200] speed presets are listed in x264 --help</span></p>
<p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">[libx264 @ 0x7fffb8003200] profile is optional; x264 defaults to high</span></p><p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)"><br>
</span></p><p style="margin:0px">Those are the settings I am using:</p></div><div><p style="margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)"><br></span></p></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">pVideoStream</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">codec</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">codec_id</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">pOutputFormat</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">video_codec</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">codec_type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">AVMEDIA_TYPE_VIDEO</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">bit_rate</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">Bitrate</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">width</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">getWidth</span><span style="color:rgb(0,0,0)">();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">height</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">getHeight</span><span style="color:rgb(0,0,0)">();</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">time_base</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">den</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">fps</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">time_base</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">num</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">gop_size</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">Gop</span><span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">pix_fmt</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span>PIX_FMT_YUV420P<span style="color:rgb(0,0,0)">;</span></pre>

<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,0)">pCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">thread_count</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">10</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">And this is what av_dump_format gives me:</span><span style="color:rgb(0,0,0)"><br>
</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><p style="font-family:arial;white-space:normal;margin:0px">
<span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">Output #0, matroska, to '/home/marika/test.mkv':</span></p><p style="font-family:arial;white-space:normal;margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)">Stream #0:0: Video: h264, yuv420p, 1920x1080, q=2-31, 50 kb/s, 90k tbn, 30 tbc</span></p>
<p style="font-family:arial;white-space:normal;margin:0px"><span style="font-family:Monaco;font-size:9pt;color:rgb(60,60,60)"><br></span></p><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Any ideas?</span><span style="color:rgb(0,0,0)"><br>
</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Thanks</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;white-space:normal">Marika</span></pre><div><span style="font-family:arial;white-space:normal"><br></span></div></pre></div></div>