<div dir="ltr">I'm trying to handle video errors in advance to avoid encoding broken files, to do it I want to decode the whole file and report if there are errors (ffmpeg 3.4.x).<div><br></div><div>I use the "new" ffmpeg APIs, so my loop is basically <br clear="all"><div><br></div><div>while av_read_frame(input) > 0 {</div><div>  if (index == video) { </div><div>     avcodec_send_packet() -> check error</div><div>     avcodec_receive_frame() -> check error</div><div>  }</div><div>}</div><div><br></div><div>the problem is that also if there are errors, for instance in one of my samples:</div><div><br></div><div><div>[h264 @ 0x7fe8a1804400] error while decoding MB 100 67, bytestream -5</div><div>[h264 @ 0x7fe8a1804400] concealing 69 DC, 69 AC, 69 MV errors in P frame</div></div><div><br></div><div>.. in another one...</div><div><br></div><div><div>[h264 @ 0x7fe8a1803800] error while decoding MB 110 67, bytestream -12</div><div>[h264 @ 0x7fe8a1803800] concealing 59 DC, 59 AC, 59 MV errors in P frame</div></div><div><br></div><div>... no API returns me the error (except some EGAIN in the first receive_frame() that must be ignored)<br></div><div><br></div><div>I've tried also to set videocontext.error_concealement = 0 without differences, I see in the video context also an undocumented err_recognition that I do not know how to use, the headers just say:</div><div><br></div><div><div>/**</div><div>     * Error recognition; may misdetect some more or less valid parts as errors.</div><div>     * - encoding: unused</div><div>     * - decoding: Set by user.</div><div>     */</div><div>    int err_recognition;</div></div><div><br></div><div>I tried to set it to 0xfffffffff and I got my first error in avcodec_send_packet, but I don't know if I made the right thing! :)</div><div><br></div><div>I remember older version of the API had error_resilience in the context that could be used to stop decoding if something went wrong, I can also find traces of it in the internet, but not in ffmpeg headers:</div><div><br></div><div><span style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FF_ER_CAREFUL</span><br style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FF_ER_COMPLIANT<span> </span></span><br style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FF_ER_AGGRESSIVE<span> </span></span><br style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(20,20,20);font-family:"Lucida Grande","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif;background-color:rgb(244,244,244);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FF_ER_VERY_AGGRESSIVE<span> </span></span><br></div><div><br></div><div>... any hints on err_recognition (if it's the right thing to set and the correct values to use)?</div><div><br></div>-- <div><b>Bye,</b><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2"><b>Gabry</b><br></font><br></div></div></div></div>
</div></div></div>

<br>
<p style="margin:0px;font-family:arial,sans-serif;background-color:rgb(255,255,255);text-align:justify"><font size="1"><font color="#808080"><span style="text-align:start">Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Società sopraindicati e non sono da considerarsi comunicazioni personali, quindi eventuali risposte potranno essere conosciute da persone appartenenti all’azienda. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita ai sensi dell’art. 616 c.p. I dati forniti verranno trattati ai sensi dell'art. 13 del Regolamento UE 2016/679 (normativa sulla privacy). Se ha ricevuto questo messaggio per errore Ti preghiamo di distruggerlo e di informarci immediatamente contattandoci mandando una mail a </span><a href="mailto:privacy@wyscout.com" style="text-align:start" target="_blank">privacy@wyscout.com</a><span style="text-align:start">. Copia integrale dell’informativa potrà essere visionata presso le nostre sedi. </span><br style="text-align:start"></font><br style="color:rgb(34,34,34);text-align:start"><font color="#808080"><span style="text-align:start">Any information herein included (even any attachments) shall be considered confidential and/or privileged material and meant to be only for the abovementioned persons and/or Company, therefore such communication is intended to be for the addressee only. Such information is not personal, that is why this e-mail and any replies may be known exclusively by people belonging to the company. It is expressively not allowed communicate, disclose and/or copy any documentation transmitted by a person other than the recipient, according to the Italian Criminal Code, Section 616 and the Regulation EU 2016/679. Your provided data are processed in accordance with Regulation EU 2016/679 (Data Protection Law), Section 13. A full copy of the relevant information notice is available at the company’s registered office upon request. If you received this in error, please destroy it and inform us immediately by sending an e-mail to the following e-mail address </span><a href="mailto:privacy@wyscout.com" style="text-align:start" target="_blank">privacy@wyscout.com</a><span style="text-align:start">. A full copy of the relevant information notice is available at the company’s registered office upon request.</span></font></font></p>