title: How does a H264 stream decoder decides which type of stream is being fed by H264 encoder
body: <p>There are two types of stream types supported or at-least recommended by the ITU-T H264 documentation i.e RTP packet and Annex B (Raw Byte Sequence).</p>
  
  <p>My question here is that lets assume that the encoder is capable of sending streaming data in both the formats and can switch between anyone of them at any point of time while streaming(correct if this is not the case), how and when does the H264 decoder comes to know that it needs to parse the data either according to RTP format or Annex B i.e Raw Byte Sequence data.</p>
  
  <p>Is there any standard protocol or mechanism to do that.</p>
  
  <p>What will happen in case there is packet loss and the encoder switches the way it was streaming data i.e either from RTP to Annex B or vice versa, here the decoder probably still assumes the data being streamed in old format.</p>
  
  <p>Kindly clarify the above.</p>