iOS Safari RTP Stream no video-orientation in SDP Answer

859 views
Skip to first unread message

Ethan D

unread,
Jun 13, 2019, 9:21:01 PM6/13/19
to kurento
Hello,

I am currently forwarding a iOS Safari stream via RTP to Kurento's RtpEndpoint and trying to view the stream via the browser using WebRtcEndpoint.
However when viewing the iOS Safari stream the video appears to be 90 degrees orientated.

I am assuming this is because the answer provided by Kurento when processing the sdp offer does not include the "urn:3gpp:video-orientation" header extension.
The only extension is seems to accept is "abs-send-time"?

Is there a way to enable this header extension or a way to show the iOS Safari stream in the correct orientation?

Below is an example Sdp Offer for the RtpEndpoint (video only):

v=0
o
=- 0 0 IP4 X.X.X.X
s
=Rtp Endpoint
c
=IN IP4 X.X.X.X
t
=0 0
m
=video 9 RTP/AVPF 99
a
=rtpmap:99 VP8/90000
a
=rtcp-fb:99 goog-remb
a
=rtcp-fb:99 ccm fir
a
=rtcp-fb:99 nack
a
=rtcp-fb:99 nack pli
a
=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a
=extmap:12 urn:3gpp:video-orientation
a
=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id

a
=sendonly

a
=direction:active

And below is the SDP Answer received from the Kurento Media Server:

v=0
o
=- 3769463827 3769463827 IN IP4 X.X.X.X
s
=Kurento Media Server
c
=IN IP4 X.X.X.X
t
=0 0
m
=video 49352 RTP/AVPF 101
a
=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a
=recvonly
a
=rtpmap:101 VP8/90000
a
=rtcp-fb:101 goog-remb
a
=rtcp-fb:101 ccm fir
a
=rtcp-fb:101 nack
a
=rtcp-fb:101 nack pli
a
=direction:passive
a
=ssrc:47285644 cname:user4210469111@host-9c98e1d0


Any help is appreciated.

Paulo R. Lanzarin

unread,
Jun 13, 2019, 11:24:30 PM6/13/19
to kur...@googlegroups.com
Kurento does not support CVO/3gpp orientation extension, as you correctly assumed. Although
it's a <conditional> must in 7742, I think it could be a tricky extension to implement for a media server.
As a stream router you have to account for those who support the extension (and hence you need to only
signal orientation angles to the remote endpoints) and those who do not (so you need to change the pre-encoding
rotation with something I'm unaware of OR re-encode the stream).


Is there a way to enable this header extension or a way to show the iOS Safari stream in the correct orientation?
So, no, I don't think you can enable it on this scenario. What you can do is disable it altogether. Although webkit
should understand that the remote endpoint doesn't support it when the answer didn't include the ext, you can make
it extra safe by munging the SDP and getting rid of the ext before setting the local descriptor in the iOS peer. If the
iOS peer is doing it correctly, it should rotate the stream properly.

If it isn't, you'll have to think about using some post-processing if it's not a live stream. If it's live, you'll have to take
a detour with gst's videoflip or a ffmpeg converter that rotates the stream.

It's odd though. I'm not quite sure what your plain-RTP-over-Safari setup is, but with the iOS/Safari endpoints I tested
that go through webkit's WebRTC implementation, I've not seen rotation mismatches, only occasional stream corruptions
in the past.

s,

Paulo

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/34f91c1f-cb53-4c93-afa6-a0b196790b96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ethan D

unread,
Jun 16, 2019, 9:11:43 PM6/16/19
to kurento
Thank you for the prompt replay.

I understand why it's hard to implement the video-orientation header, thanks for the explanation.

My plain RTP safari setup is basically I normally use a SFU media server, participants use the VP8/H264 video codec.
However older versions of Safari do not support viewing VP8 so for these viewers I relay the VP8 RTP stream to Kurento
and have Kurento transcode it into WebRTC H264 so that older versions of Safari can also view the stream.
I have had no issues with other devices only iOS Safari.

If there is no other way I will simple make it so that iOS Safari produces in H264.

Thanks for your help.
Reply all
Reply to author
Forward
0 new messages