Symmetric RTP / socket reuse flag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Symmetric RTP / socket reuse flag

Renaud Schoonbroodt
Hi everyone,

I am implementing a SIP user agent (softphone) in C++ where the media
encoding and decoding is handled by ffmpeg.  I basically have one PCMU
encoder and one PCMU decoder. Taken separately they both works fine.

To cope with NAT traversal issues, I need to do Symmetric RTP
https://tools.ietf.org/html/rfc4961

Basically it means that my encoder and decoder need to use the same port.
But when I enable both encoder and decoder one fails I guess because the
port can't be reused.  Again, enabled separately it works like a charm.

I see the existence of the "reuse_socket" AVOption for UDP socket. But I
have very little experience with the ffmpeg API and don't know how to
access UDPContext form an AVFormatContext or AVCodecContext.

I have also seen the "reuse" flag for URL but it doesn't seem to work with
RTP.

Does someone already succeed in doing this ?  Am I looking in the right
direction ?

Thanks

Best regards,

Renaud
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Symmetric RTP / socket reuse flag

Renaud Schoonbroodt
Hi,

As the reuse option is not available for RTP, I have modified ffmpeg source
to add it. Unfortunately though the socket address is effectively reused
between my encoder and decoder (no more binding errors), the decoder fails
on av_read_frame with error -8a. I have not idea what can cause this.

So am trying to find another solution: is there is a way to open a
AVFormatContext for both reading and writing ?
I am hoping to use the socket for both encoding and decoding.

Furthermore, is there a way to disable RTCP ?

Thanks

Renaud




On Sun, 9 Sep 2018 at 18:29, Renaud Schoonbroodt <
[hidden email]> wrote:

> Hi everyone,
>
> I am implementing a SIP user agent (softphone) in C++ where the media
> encoding and decoding is handled by ffmpeg.  I basically have one PCMU
> encoder and one PCMU decoder. Taken separately they both works fine.
>
> To cope with NAT traversal issues, I need to do Symmetric RTP
> https://tools.ietf.org/html/rfc4961
>
> Basically it means that my encoder and decoder need to use the same port.
> But when I enable both encoder and decoder one fails I guess because the
> port can't be reused.  Again, enabled separately it works like a charm.
>
> I see the existence of the "reuse_socket" AVOption for UDP socket. But I
> have very little experience with the ffmpeg API and don't know how to
> access UDPContext form an AVFormatContext or AVCodecContext.
>
> I have also seen the "reuse" flag for URL but it doesn't seem to work with
> RTP.
>
> Does someone already succeed in doing this ?  Am I looking in the right
> direction ?
>
> Thanks
>
> Best regards,
>
> Renaud
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".