Question

I have simple Rtsp Source Filter which connects Rtsp Server and get Rtp packets. The problem is that i have to set media subtype in my Rtsp Source Filter Pin...[ Now i give substype hard-coded]

pMediaType->SetSubtype(&MyHardCodedSubTypeGUID);

What i want is create my pin dynamically with subtype according to coming stream. I get h264 and mpeg-4 streams from server.Their rtp packet payload format is dynamic: 96...Does not help me to identify if stream is mpeg4 or h264...

FFmpeg can able to get stream type[h264,mpeg4] from codec info...But how can i do myself?

Best Wishes

Was it helpful?

Solution

RTP payload is not only dynamic (96, 97 etc), it is also provided with payload type attributes you need to obtain format from and convert into DirectShow media type (see "H264*" below):

m=video 0 RTP/AVP 96 
a=rtpmap:96 H264/90000 
a=control:trackID=1
a=fmtp:96 packetization-mode=1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top