Aspect Ratio

233 views
Skip to first unread message

Kevin Maude

unread,
May 22, 2020, 8:25:01 PM5/22/20
to Ant Media Server
Is there a setting that controls the aspect ratio of the webrtc stream?
I have the video on the index.html page set to 1280x720.
The play.html page is set to an aspect of 1280x720 for both HLS and Webrtc player. However as soon as the stream starts it reverts back to a 640x480 stream in the center of a 16:9 video player. 

Robert Berger

unread,
May 23, 2020, 3:24:50 PM5/23/20
to Ant Media Server
I would be interested in the answer to this question as well

Kevin Maude

unread,
May 28, 2020, 12:49:29 AM5/28/20
to Ant Media Server
Checking back to see if anybody might have some insight on controlling the aspect for the webrtc stream.

In trying to research it the thought that might need something with the webcam setting reset. Not sure however.

Any help much appreciated

Logan McDonald

unread,
May 28, 2020, 2:48:25 PM5/28/20
to Ant Media Server
Is this a WebRTC published stream? If yes, are you publishing at that size? Many webcams, like mine, default to 4:3 in Chrome. Search for the mediaConstraints variable on index.html and replace it with this:

var mediaConstraints = {
video : {
"width": {
"min": 1280,
"max": 1920
},
"height": {
"min": 720,
"max": 1080
}
},
audio : true
};

Note that if you try to publish after adding this change with any device that doesn't support at or above 1280x720, the browser will reject the attempt to publish and it will fail.

Kevin Maude

unread,
May 28, 2020, 6:16:12 PM5/28/20
to Logan McDonald, Ant Media Server
Logan,

Thank you for the response. The challenge I've had is that I can get a 16:9 image on the publish page. You can see in this image.
Screenshot 2020-05-28 15.11.41.png
But then when I view the stream on the play.html page it is squishing to 4:3. See this image.
Screenshot 2020-05-28 15.12.11.png

Trying to get the final image to be 16:9 for both the stream and record. 

Thanks,

Kevin

--
You received this message because you are subscribed to the Google Groups "Ant Media Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ant-media-serv...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ant-media-server/c23bf425-2d18-47af-91c6-a948f6e36acc%40googlegroups.com.


--
Kevin Maude
www.socialvideo.online
Want to schedule a meeting, check my availability

Anthony

unread,
May 29, 2020, 4:57:13 PM5/29/20
to Ant Media Server

I follow the question with interest. 
It would be really helpful to comprehensively understand how to flexibly set aspect ratio and resolution in Publish and Play examples.

To unsubscribe from this group and stop receiving emails from it, send an email to ant-medi...@googlegroups.com.

Martin

unread,
Aug 19, 2020, 5:32:35 PM8/19/20
to Ant Media Server
I have the same problem with streaming a 16:9 WebRTC screen share. When playing with HLS, I get 4:3 aspect ratio.
To unsubscribe from this group and stop receiving emails from it, send an email to ant-medi...@googlegroups.com.

burak

unread,
Aug 22, 2020, 10:08:08 AM8/22/20
to Ant Media Server
In community edition this is normal. Because we set the resolution 640x480 in the following line:

So you can consider using 4:3 on the publishing side or you can edit the line as 640x360 and build it from scratch.

20 Ağustos 2020 Perşembe tarihinde saat 00:32:35 UTC+3 itibarıyla Martin şunları yazdı:
Reply all
Reply to author
Forward
0 new messages