Hi dear community,<br>                             I have a problem with the encoding using x264. After I call x264_encoder_encode( h, &amp;nal, &amp;i_nal, pic, &amp;pic_out)  function I have nal= NULL, i_nal=0 and the function return 0. I&#39;m sure that pic contain the correct image. The x264_t h is open using the default parameters, i only change width and length of the video. The function don&#39;t give me any error, it seems that it not encode any data. I include the code of encoding function that I implement watching x264.c.<br>
<br>void MyFunction()<br>{<br>    x264_param_t param;<br>        x264_t *h;<br>    x264_picture_t pic;<br><br>    //Set the default parameters<br>    x264_param_default( &amp;param );<br><br>    //Video settings<br>    param-&gt;i_width = WIDTH;<br>
    param-&gt;i_height = HEIGHT;<br><br>    //Open the encoder<br>    if( ( h = x264_encoder_open( &amp;param ) ) == NULL )<br>    {<br>           fprintf( stderr, &quot;x264 [error]: x264_encoder_open failed\n&quot; );<br>
           return -1;<br>    }<br><br>    /* Create a new pic */<br>    x264_picture_alloc( &amp;pic, X264_CSP_I420, param.i_width, param.i_height );<br><br>    //Launch the encode routine    <br>    Encode_frame( h , &amp;pic );<br>
<br>    //Release resoirce<br>    x264_picture_clean( &amp;pic );<br>    x264_encoder_close(h);<br>}<br><br>int Encode_frame( x264_t *h , x264_picture_t *pic)<br>{<br>        x264_nal_t *nal;<br>        int i_nal, i;<br>        x264_picture_t pic_out;<br>
        static int mux_buffer_size = 0;<br>        uint8_t *mux_buffer = NULL;<br>        int size;<br><br>        //Set YUV420<br>        pic-&gt;img.i_csp = X264_CSP_I420;<br>        pic-&gt;img.i_plane = 3;<br><br>        //I take the YUV image from a decoded image decode with ffmpeg<br>
        if (picture) {<br>            for(i = 0; i &lt; 3; i++){<br>                pic-&gt;img.plane[i] = picture-&gt;data[i];<br>                pic-&gt;img.i_stride[i] = picture-&gt;linesize[i];<br>            }<br><br>
            pic-&gt;i_pts = picture-&gt;pts;<br>            pic-&gt;i_type = X264_TYPE_AUTO;<br>        }<br>    <br>        //pic contains the correct image. <br>        if( (i = x264_encoder_encode( h, &amp;nal, &amp;i_nal, pic, &amp;pic_out)) &lt;0)<br>
            return -1;    <br><br>        /*<br>         *   In this point nal is null, i_nal is 0. There isn&#39;t any error message in the routine.<br>         *   As consequence the next loop don&#39;t execute any step.<br>
         */ <br>        <br><br>        //packetize the encoded information in nal unit<br>        for( i = 0; i &lt; i_nal; i++ )<br>        {<br>            int i_size;<br><br>            printf(&quot;\nNal unit n° %d&quot;,i);<br>
<br>            if( mux_buffer_size &lt; nal[i].i_payload * 3/2 + 4 )<br>               {<br>                    mux_buffer_size = nal[i].i_payload * 2 + 4;<br>                    free( (void*) mux_buffer );<br>                    mux_buffer = (uint8_t*) malloc( mux_buffer_size );<br>
            }<br><br>            size = size + mux_buffer_size;<br>            i_size = mux_buffer_size;<br>            x264_nal_encode( mux_buffer, &amp;i_size, 1, &amp;nal[i] );<br>            write_nal_unit( mux_buffer , i_size ,&quot;outframe.mpeg4&quot; );<br>
        }<br><br>    return size;<br>}<br><br>I&#39;m excuse in advance. I&#39;m not sure that is the correct mailing list (if not is very appreciated if suggest me what mailing list is the right).<br>Many thanks.