How to adjust aspect ratio and resolution in tokbox - webrtc

I've created a simple WebRTC chat app using tokbox / opentok 2.0.
However, I am having trouble figuring out how to make sure that the video appears in a 16.9 aspect ratio. The default on most systems is 4.3, and on my MacBook Pro, I am getting 16.9 squished into a 4.3 box.
Is there an api call I am missing to force a widescreen aspect ratio?

There is no way to change the aspect ratio on TokBox's API, although you can set the width and height properties when you call initPublisher or session.subscribe(). It says in the documentation:
If the width and height of the display do not match the 4:3 aspect ratio of the video signal, the video stream is cropped to fit the display.

Related

React native, how can i set font Size in pixels?

How can i set font Size in pixels?
Hello,
Designer send me sizes of app components. Header must be 60 pixels
, but if i put font size 60, it is very big. How can i adjust it for pixels. Thank you. (IOS DEVICE)
You cannot do pixels on mobile. You do DPI. Tell your designer to get with the tech. He's designing for web. While you can figure out how many DPI correlate to how many pixels for the current device (its a device specific thing) with the PixelRatio API - https://facebook.github.io/react-native/docs/pixelratio.html - it's putting in effort to make your design worse. DPI works great across different screens/sizes.

How to get full resolution through Liveview

I am using SDK 2.3 and develop an Android application with AS-15 and 20 camera that is exclusively dealing with liveview.
I unable to obtain from Liveview a higher resolution than 640x360px, while the camera specs mention a 1920×1080/30P (HQ).
How can I get the full resolution?
Is this a limitation of the API ? Why?
I've found that some (other) cameras implement get/setLiveviewSize and with the L it says
XGA size scale (the size varies depending on the camera models, and some camera models change the liveview quality instead of making the size larger.)
What are the models with the highest liveview resolution?

What is the natural/normal aspect ratio of videos created either by vLine or by WebRTC

Whe creating a video element using vLine's createVideoElement function, what is the aspect ratio of the video that will be shown in that element? Is there a default ratio - one that WebRTC generates - or is it something that is set programmatically (e.g., inside a library like vLine)?
The default aspect ratio should be 4:3 when using createVideoElement in the vLine API.

Why are the maximum X and Y touch coordinates on the Surface Pro is different from native display resolution?

I have noticed that the Surface Pro and I believe the Sony Vaio Duo 11 are reporting maximum touch coordinates of 1366x768, which is surprising to me since their native display resolution is 1920x1080.
Does anyone know of a way to find out at runtime what the maximum touch coordinates are? I'm running a DirectX app underneath the XAML, so I have to scale the touch coordinates into my own world coordinates and I cannot do this without knowing what the scale factor is.
Here is the code that I'm running that looks at the touch coordinates:
From DirectXPage.xaml
<Grid PointerPressed="OnPointerPressed"></Grid>
From DirectXPage.xaml.cpp
void DirectXPage::OnPointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
{
auto pointerPoint = args->GetCurrentPoint(nullptr);
// the x value ranges between 0 and 1366
auto x = pointerPoint->Position.X;
// the y value ranges between 0 and 768
auto y = pointerPoint->Position.Y;
}
Also, here is a sample project setup that can demonstrate this issue if run on a Surface Pro:
http://andrewgarrison.com/files/TouchTester.zip
Everything on XAML side is measured in device independent pixels. Ideally you should never have to worry about actual physical pixels and let winrt do its magic in the background.
If for some season you do need to find you current scale factor you can use DisplayProperties.ResolutionScale and use it to convert DIPs into screen pixels.
their native display resolution is 1920x1080
That makes the display fit the HD Tablet profile, everything is automatically scaled by 140%. With of course the opposite un-scaling occurring for any reported touch positions. You should never get a position beyond 1371,771. This ensures that any Store app works on any device, regardless of the quality of its display and without the application code having to help, beyond providing bitmaps that still look sharp when the app is rescaled to 140 and 180%. You should therefore not do anything at all. It is unclear what problem you are trying to fix.
An excellent article that describes the automatic scaling feature is here.

equal video dimensions have same aspect ratio

I uploaded a test video on YouTube with a 2.39:1 aspect ratio and YouTube converted it into the following qualities: 240p, 360p 480p, 720p, 1080p.
I downloaded the 1080p video to check its dimensions and they were 1920 x 664, or an aspect ratio of 2.89:1.
Does that mean that "1080p videos" don't need to have a 16:9 aspect ratio?
Let's say I have two videos, both 1920x1080.
Does that mean that both videos have same aspect ratio of 16:9 ?
Does that mean videos qualified as 1080p need to have:
dimensions 1920x1080
aspect ratio 16:9
Wikipedia says "1080p is a set of HDTV high-definition video modes that are characterized by 1080 horizontal lines of vertical resolution and progressive scan. The term assumes a widescreen aspect ratio of 16:9, thus implying a resolution of 1920 × 1080 (2.1 megapixels)," although no credible source is cited.
YouTube/Google define their interpretation of 1080p in YouTube Player API Reference for Embeds: Playback quality:
Quality level hd1080: Player height is 1080px, and player dimensions
are 1920px by 1080px (for 16:9 aspect ratio) or 1440px by 1080px (for
4:3 aspect ratio).
I've never heard of a 2.89 aspect ratio. 16/9 = 1.7̅ 1920 x 664 is really strange. Maybe it's a bug in YouTube's converter. But I guess you could gain more control by uploading video which you've already converted to a standard aspect ratio yourself.