Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reception of a webcam on an iPhone 8 iOS 14.6 is sometimes 90° or 180°, suddenly the character is all turned upside down #265

Open
Madriix opened this issue Jun 1, 2021 · 8 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Madriix
Copy link

Madriix commented Jun 1, 2021

The reception of a webcam on an iPhone 8 iOS 14.6 is sometimes 90 ° or 160 °, suddenly the character is all turned upside down.

How should this be resolved?

Both are affected: https://github.com/meething/meething and https://github.com/meething/meething-mediasoup

Is there a parameter to adjust?

@Dletta
Copy link
Collaborator

Dletta commented Jun 1, 2021 via email

@Madriix
Copy link
Author

Madriix commented Jun 1, 2021

I do not know the parameters of the camera on iPhone, the iPhone is brand new I got it last week, it is mainly used for debugging. All options are default as for the majority of all people.
For sending from the camera it is in the right direction, but for the recipient (remote) it is in the wrong direction. This does not happen on other appli (ex https://github.com/dmotz/trystero), the camera is normal on iPhone for example for the recipient

@Madriix
Copy link
Author

Madriix commented Jun 1, 2021

I have just retested the demo on https://us.meething.space/ on both my iPhone and my PC, by checking "P2P Mesh Only" the camera receiving bug does not occur wrong way. Why does this happen by unchecking it? It's strange.

To sum up:

  • With the option checked "P2P Mesh Only", the reception of the camera from an iPhone user is correct
  • With the option "P2P Mesh Only" disabled the reception of the camera from an iphone user is not correct, it is often at 90 ° or 180 °

@Dletta
Copy link
Collaborator

Dletta commented Jun 1, 2021 via email

@Madriix
Copy link
Author

Madriix commented Jun 1, 2021

@Dletta
The camera in front of her does the same, at 90 °
The day before yesterday a woman tested with her iPad, the camera was completely 180 °, head down, and the chair at the top of the screen

And I did another test by checking "P2P Mesh Only", and the format is correct, there is only in P2P that the direction of the camera is correct for the front camera and rear camera

@Madriix
Copy link
Author

Madriix commented Jun 1, 2021

The problem also exists on https://v3demo.mediasoup.org/?roomId=[Name]
It's a shame it's a disadvantage

@Madriix
Copy link
Author

Madriix commented Jun 1, 2021

I opened a ticket on versatica/mediasoup#577

@Madriix Madriix changed the title Reception of a webcam on an iPhone 8 iOS 14.6 is sometimes 90° or 160°, suddenly the character is all turned upside down Reception of a webcam on an iPhone 8 iOS 14.6 is sometimes 90° or 180°, suddenly the character is all turned upside down Jun 1, 2021
@Madriix
Copy link
Author

Madriix commented Jun 2, 2021

I modified this code in https://github.com/meething/meething-mediasoup/blob/master/client/lib/room.js :

async function onPeerOpen() {
  const device = new Device();
  const routerRtpCapabilities = await this.peer
  .request("getRouterRtpCapabilities")
  .catch(console.error);
  
  routerRtpCapabilities.headerExtensions = routerRtpCapabilities.headerExtensions.
  filter((ext) => ext.uri !== 'urn:3gpp:video-orientation');
  
  await device.load({ routerRtpCapabilities });
  await this._prepareSendTransport(device).catch(console.error);
  await this._prepareRecvTransport(device).catch(console.error);

  const res = await this.peer.request("join", {
    rtpCapabilities: device.rtpCapabilities
  });
  
  this.emit("@open", res);
}

It seems to be working fine now

@Dletta Dletta added bug Something isn't working enhancement New feature or request labels Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants