<div dir="ltr"><div dir="ltr">Dear developers,<div><br></div><div>I am trying to use the nalu_process callback to send out NAL units as soon as they are encoded for low-latency streaming applications. My implementation is as follows.</div><div><div>void nalu_process(x264_t *h, x264_nal_t* nal, void* opaque){</div><div>  int first_mb, last_mb;</div><div>  unsigned char* dst = (unsigned char*) malloc(nal->i_payload*3/2 + 5 + 64);</div><div>  x264_nal_encode(h, dst, nal);</div><div>  if(nal->i_type == 6 || nal->i_type == 7 || nal->i_type == 8){</div><div>    first_mb = 0;</div><div>    last_mb = 0;</div><div>  }else{</div><div>    first_mb = nal->i_first_mb;</div><div>    last_mb = nal->i_last_mb;</div><div>  }</div><div>  send_packet_to_receiver(sock_send, sock_send_si_other, nal->p_payload, nal->i_payload, fof, first_mb, last_mb);</div><div>  if(fof == 1)</div><div>    fof = 0;</div><div>}</div></div><div><br></div><div>The callback is called four times and I can get 4 NAL units consequentially with the following settings. I guess it is 4 because my PC's CPU has 4 cores.</div><div>x264_param_default_preset(param, "ultralow", "zerolatency");</div><div>x264_param_apply_profile(param, "main");</div><div>param->b_sliced_threads=1;</div><div><br></div><div>However, I do not want to use sliced-based threading in my app. So, I change the settings to:</div><div>x264_param_default_preset(param, "ultralow", "zerolatency");</div><div>x264_param_apply_profile(param, "main");</div><div>param->b_sliced_threads=0;</div><div>param->i_sliced_count = 2;</div><div><br></div><div>In this case, the callback is not called at all. How should I change the settings to get the callback called if I still want b_sliced_threads = 0.</div><div><br></div><div>Best regards,</div><div>-- <br></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Duc V. Nguyen<br>2nd year PhD student, Computer Communications Lab., The University of Aizu, Japan.<br>Email: <a href="mailto:d8182101@u-aizu.ac.jp" target="_blank">d8182101@u-aizu.ac.jp</a>, <a href="mailto:nvduc712@u-aizu.ac.jp" target="_blank">nvduc712@u-aizu.ac.jp</a><div>Homepage: <a href="https://ducnguyen712.blogspot.jp/" target="_blank">https://ducnguyen712.blogspot.jp/</a></div></div></div></div></div></div></div></div>