Muxing MP4 with a profile that has multiple SPS/PPS
<p>The ISO/IEC 14496-15 specification "Information technology — Coding of
audio-visual objects — Part 15: Advanced Video Coding (AVC) file format" that describes the <code>avc1</code> box used in MP4 files states that the <code>avc1</code> box can contain multiple SPS and PPS entries for a single sample description (not to be confused with repeated SPS/PPS). And I am not sure how to mux such streams:</p>

<ul>
<li>So far I've seen H.264 high profile streams with multiple PPS nal units for a single sample description. What confuses me is that since I've never personally seen a H.264 stream with multiple SPS units - is that even possible and what is the reasoning behind that?.</li>
<li>If that is possible - what happens to the <code>AVCProfileIndication</code> and <code>AVCLevelIndication</code> fields in the <code>avc1</code> box? Should they be filled from the first SPS entry? If there are multiple SPS entires, I guess the profile indication should not differ, but what about level?</li>
</ul>