<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi All:</div><div class=""><br class=""></div>My box is CentOS6.5, and FS is 1.6.4<div class=""><br class=""></div><div class="">When I use H264 as the video codec.</div><div class="">FS report encoding fail as below.</div><div class=""> [ERR] avcodec.c:1117 Encoding Error -1</div><div class="">and x264 report</div><div class=""> lookahead thread is already stopped</div><div class=""><br class=""></div><div class="">I checked the source code, I found that</div><div class="">when switch_h264_encode encode is invoked first time, it results that context->got_encoded_output is set to 1.</div><div class="">and after that, if switch_h264_encode is invoked again, it will check context->got_encoded_output , and then pass null frame to avcodec_encode_video2 which will stop the lookahead thread because of the null frame.</div><div class=""><div class="">switch_h264_encode:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if (*got_output) { // Could be more delayed frames</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>ret = avcodec_encode_video2(avctx, pkt, <b class="">NULL</b>, got_output);</div></div><div class=""><br class=""></div><div class="">Is it a bug of mod_av or how can i solve the problem?</div><div class=""><br class=""></div><div class="">Thanks a lot</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>