Recording a rotating video stream


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

o=- 0 0 IN IP4
c=IN IP4
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).



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

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


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

It helped. Thanks! I wonder why?

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. :thinking:

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