What I am trying to do
Stream live H.264 data over the network and use hardware acceleration to decode it as specified in the WWDC video so I can play it in my iOS app in real time.
What I have tried
I have read RFC 6184 extensively and believe I have my head wrapped around it. I assume the RTP packets I am receiving are in the format specified in the RFC. I am also assuming the stream will be in non-interleaved mode. So my application reads in each nalu packet and determines if it is a single nalu packet (type < 24), aggregated packet (type = 24), or fragmented packet (type = 28). From there I am just logging the data of what type of nalu I am receiving because I wanted to make sure the data is coming in the form I expect and being appropriately parsed before moving on.
What happens
When I log the nalu types I get nal units with a type of 0, 1, 2 with occasional PPS nalus as shown in the picture.
I know that I should receive a SPS and a PPS as the first 2 packets so I know something is wrong.
My question
I am using VLC to stream the data. I am transcoding it in H.264 and with the encapsulation format MPEG TS. Now, when I first started this I thought I as long as I was streaming H.264 it would be in the format specified in the RFC. But after doing some research about MPEG TS and how it is a container format I think my stream is not in the format specified in the RFC.
If I am actually streaming the video in a format different from the RFC, how would I use VLC (or an equivalent program) to stream the data in the form of the RFC? All the posts on SO such as this and the WWDC video talk about looking for a start code (0x0001 or 0x000001) for each nalu but the RFC never mentions it. So I am not sure if that is the reason I am getting weird results is due to me not looking for a start code or if it is because I am not receiving the data in the RFC format. I greatly appreciate any help especially since I am new to video decoding in general and feel like I am almost there!