<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi,</div>
<div><br>
</div>
<div>x264 will always have at least a 1 frame encoder lag when b_vfr_input is set (as it is for your use case). The first frame is still encoded, you just won't receive the coded data until the next x264_encoder_encode() call.</div>
<div><br>
</div>
<div>/Gil</div>
<br>
<div>
<div>On 23/08/2011, at 11.54, Lucas Zhang wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Now I found a method to collect every frame picture of phone's camera and write them into a file. Then I read these data from the file, and use x264_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in,
x264_picture_t *pic_out ); to do the compression. However, the *pi_nal always return 0 when processing the first frame, and the output video is full of green pictures. Does anyone encounter this problem? Thank you~ Below is my setting.
<div><br>
</div>
<div>
<div> x264_param_default(param); //set default param</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>param->i_width = width; //set frame width</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>param->i_height = height; //set frame height</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>param->rc.i_lookahead =0;</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>param->i_fps_num = fps;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>param->i_fps_den = 1;</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>x264_param_apply_profile(param,"baseline");</div>
<br>
<div class="gmail_quote"><br>
</div>
<div><br>
</div>
-- <br>
Zhang Qing (张卿)<br>
<a href="http://about.me/zhang_qing" target="_blank">http://about.me/zhang_qing</a><br>
</div>
_______________________________________________<br>
x264-devel mailing list<br>
<a href="mailto:x264-devel@videolan.org">x264-devel@videolan.org</a><br>
http://mailman.videolan.org/listinfo/x264-devel<br>
</blockquote>
</div>
<br>
</body>
</html>