To the demux the input is a byte stream. Everything is just zero's and one's. Now how does the parser differentiate between 0x47 in the data and the 0x47 that is the sync byte of the Transport stream header?
For example, if the data that the demux receives is 0x47 0x56 0xef 0x47 ... How will it know which 0x47 is the sync byte?
Does it look for any additional bit after the sync byte to ensure that the 0x47 it read is indeed the start of the header? What is the mechanism?
The same holds true for any parser for that matter. The H.264 parser checks for the NAL start code. How does it differentiate between the actual start code and the start code in the data. Because for the parser everything is just bytes.
Thank You.