title: How to fetch h.264 bytes from iPhone Camera?
body: <p>I need to publish live video stream from iPhone Camera to RTMP Server (Wowza server). The video stream must be in h.264 format. I know AVFoundation stores video to a file in h.264 compression but I don;t need to store the video to a file. I just want to capture and send it to the server. I am using following delegate method :</p>
  
  <pre><code>    - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{
               if (connection == videoConnection) {
               //I want something like this
               NSData* h264VideoData=[self h264Data:sampleBuffer];
          }
  
  }
  </code></pre>
  
  <p>I don't need to send audio to the server, I just want to send video. </p>