title: Streaming output of x264_encoder_encode
body: <p>how can I stream the output of x264_encoder_encode over UDP?</p>
  
  <p>This is my Init_x264-function:</p>
  
  <pre><code>x264_param_t param;
  x264_param_default_preset(&amp;param, "veryfast", "zerolatency");
  param.i_threads = 1;
  param.i_width = width;
  param.i_height = height;
  param.i_fps_num = 30;
  param.i_fps_den = 1;
  
  param.i_keyint_max = 30;
  param.b_intra_refresh = 1;
  
  param.rc.i_rc_method = X264_RC_CRF;
  param.rc.f_rf_constant = 25;
  param.rc.f_rf_constant_max = 35;
  
  param.b_annexb = 1;
  param.b_repeat_headers = 1;
  
  param.i_log_level = X264_LOG_DEBUG;
  
  x264_param_apply_profile(&amp;param, "baseline");
  
  encoder = x264_encoder_open(&amp;param);
  
  picIn = new x264_picture_t;
  picOut = new x264_picture_t;
  x264_picture_alloc(picIn, X264_CSP_I420, width, height);
  x264_encoder_parameters(encoder, &amp;param);
  </code></pre>
  
  <p>Now instead of saving the output of x264_encoder_encode to disk (using fwrite) I tried to just send it over UDP to my destination. I tried to play it with avplay, but it fails:</p>
  
  <pre><code>[h264 @ 0x7f83f0012e80] non-existing PPS 0 referenced
  [h264 @ 0x7f83f0012e80] decode_slice_header error
  [h264 @ 0x7f83f0012e80] no frame!
  [h264 @ 0x7f83f0012e80] non-existing PPS 0 referenced
  [h264 @ 0x7f83f0012e80] decode_slice_header error
  [h264 @ 0x7f83f0012e80] no frame!
  </code></pre>
  
  <p>With vlc I got different error messages, mostly about missing headers.</p>