 <p>If all you want to do is capture the h.264 stream and stick it into a container, I would utilize FFmpeg. I don't know the exact command line, so this is untested but try something like...</p> <pre><code>ffmpeg -i - -f mp4 output.mp4 </code></pre> <p>Then, write to it over STDIN. It should detect your stream type after several packets, and begin writing to the MP4 file.</p>