Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Update for 2017:</strong></p> <p>You can do streaming Video and Audio now by using the <code>VideoToolbox</code> API. Read the documentation here: <a href="https://developer.apple.com/reference/videotoolbox/vtcompressionsession-7bn" rel="nofollow noreferrer">VTCompressionSession</a></p> <p><strong>Original answer (from 2013):</strong></p> <p>Short: You can't, the sample buffer you receive is uncompressed.</p> <p>Methods to get hardware accelerated h264 compression:</p> <ul> <li><a href="http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAssetWriter_Class/Reference/Reference.html" rel="nofollow noreferrer">AVAssetWriter</a></li> <li><a href="https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureMovieFileOutput_Class/Reference/Reference.html" rel="nofollow noreferrer">AVCaptureMovieFileOutput</a></li> </ul> <p>As you can see both write to a file, writing to a pipe does not work as the encoder updates header information after a frame or GOP has been fully written. So you better don't touch the file while the encoder writes to it as it does randomly rewrite header information. Without this header information the video file will not be playable (it updates the size field, so the first header written says the file is 0 bytes). Directly writing to a memory area is not supported currently. But you can open the encoded video-file and demux the stream to get to the h264 data (<strong>after</strong> the encoder has closed the file of course)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload