# Recording a rotating video stream

**URL:** <https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383>\
**Category:** mediasoup libraries\
**Created:** [November 8, 2019, 9:05am UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383 "2019-11-08T09:05:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anovikov1984](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/anovikov1984/32/226_2.png) [@anovikov1984](https://mediasoup.discourse.group/u/anovikov1984)\
**Post date:** [November 8, 2019, 9:05am UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/1 "2019-11-08T09:05:14Z")

</div>

Hello!

Trying to record video that comes from an iPad. It works, but when i am rotating iPad along the horizontal axis, video rotates in the recording while it fixes itself in the received stream. So basically if i put iPad upside down, my face will be upright on the stream my viewers receive real time over webrtc, but upside down in the recording.

Is there a way to fix this?

I am using RtpStreamer to record, and ffmpeg with a simplistic SDP to receive

```auto
v=0
o=- 0 0 IN IP4 127.0.0.1
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 56.15.102
m=audio ${Recorder.rtpPort(producer.kind,rtpIndex)} RTP/AVP 100
a=rtpmap:100 OPUS/48000/2
m=video ${Recorder.rtpPort(producer.kind,rtpIndex)} RTP/AVP 101
a=rtpmap:101 VP8/90000`;

```

, as you see no tricks (probably i need some SDP trick to support rotation, that’s what my guess is).

Thanks!

Alexander

PS: Weirdly enough, it works on Android tablet just fine. Problem is only on iPad. And iPhone too.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [November 8, 2019, 10:40am UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/2 "2019-11-08T10:40:48Z")

</div>

Could you try removing the below header extension from the video producer on the client/server side:

```auto
urn:3gpp:video-orientation

```

---

<div class="post-metadata">

**Author:** ![anovikov1984](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/anovikov1984/32/226_2.png) [@anovikov1984](https://mediasoup.discourse.group/u/anovikov1984)\
**Post date:** [November 8, 2019, 10:42am UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/3 "2019-11-08T10:42:58Z")

</div>

you mean remove it by hacking SDP on a client which sends the video? what will be the expected result of it?

---

<div class="post-metadata">

**Author:** ![anovikov1984](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/anovikov1984/32/226_2.png) [@anovikov1984](https://mediasoup.discourse.group/u/anovikov1984)\
**Post date:** [November 8, 2019, 11:48am UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/4 "2019-11-08T11:48:24Z")

</div>

It helped. Thanks! I wonder why?

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [November 8, 2019, 12:02pm UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/5 "2019-11-08T12:02:48Z")

</div>

It seems to be an iOS only problem.  
When viewing/recording an iOS stream if both endpoints don’t support the video-orientation extension, the orientation of the iOS stream is not shown correctly. 🤔

Removing the video-orientation header solves the problem, however the video may freeze if the device is rotated 270 degrees…

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 2, 2019, 11:11pm UTC](https://mediasoup.discourse.group/t/recording-a-rotating-video-stream/383/6 "2019-12-02T23:11:00Z")

</div>


