MSalters
MSalters

Reputation: 179819

How to pass multiple RTP options to ffmpeg?

Building my own RTSP server for FFMPEG, so I'm executing ffmpeg as a child process.

The problem I currently have is that I'm adding multicast support, and an RTSP client may add ttl to the RTSP Transport line. No problem so far, as ffmpeg supports that. But exactly how do I pass it? The documented URL format is

 rtp://hostname[:port][?option=val...]

That's not the sort of definition you should write if you want to pass a Comp.Sci class. The ellipsis suggests you can pass more than one parameter, but not how. And I need not just ttl= but also localrtpport=.

I suppose I could follow HTTP conventions and assume that they intended [?option=val[&option=val]*] but I can't find an authoritative source for that.

Asked elsewhere but unanswered there too.

Upvotes: 2

Views: 1028

Answers (1)

MSalters
MSalters

Reputation: 179819

I cheated and looked at the source.

rtp_open calls av_find_info_tag which is documented to parse ?tag1=val1&tag2=val2....

And to answer the obvious follow-up questions, I also checked the source for av_find_info_tag. There is no limit on the number of arguments that can be passed, they have to be separated by &, and (implementation detail) only the first occurrence of a parameter is used. Unsupported parameters are silently ignored.

Upvotes: 4

Related Questions