Max video/audio quality: Native Facebook RTMP client on mobile vs WebRTC on mobile via Ant Media

400 views
Skip to first unread message

lars schwarz

unread,
Aug 11, 2021, 3:34:40 PM8/11/21
to Ant Media Server
Hey guys,

we publish to Facebook RTMP via WebRTC in 720p using a max bitrate of 4000.

If we use the native Facebook app to do the same (publish to Facebook Live) the resulting video looks much "sharper" and the audio quality also seems better. 

We use H.264 and no ABR, both videos were done on the same device and with excellent bandwidth/upload speed.

Question is: is this quality difference expected or is there any setting (on the WebRTC-side or via red5-web.properties config) that allows us to improve the quality so it matches what the native FB app produces on the same device/same resolution (720p)?

Thanks
Lars

Ant Media Support

unread,
Aug 11, 2021, 3:48:15 PM8/11/21
to lars.s...@gmail.com, ant-medi...@googlegroups.com
Hi Lars,
Pardon me if I didn't understood your query well and feel free to correct me. But let me try to answer, the default bandwidth set for WebRTC stream in AMS is 900Kbps and FPS is at 20
You can change these parameters to suit your requirement under application settings /usr/local/antmedia/webapps/LiveApp/WEB-INF/red5-web.properties
Also, we recommend not to set bandwidth higher that 2.5Mbps in WebRTC stream so that it stays true to real time communication.
Let me know if this helps and/or if I'm missing something.

--
Cheers,
Mohit Dubey

 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.


, Lars Schwarz <lars.s...@gmail.com> wrote:
--
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/2bfeb9e9-fbbd-4e5c-a038-40bbe2a972d8n%40googlegroups.com.
45578:1264838

lars schwarz

unread,
Aug 11, 2021, 4:02:15 PM8/11/21
to Ant Media Server
Hey Mohit,

Facebook recommends a video bitrate of 1,500 to 4,000 Kbps for 720p at 30fps when using their Live API, that's why we tried a maxVideoBitrateKbps of 4000 (Bandwidth parameter on the WebRTCAdaptor connector). 

When we publish to Facebook RTMP via WebRTC using Ant Media (H.264, no ABR) the resulting video quality isn't as good/sharp compared to using Facebook's native app to publish a live video. 

So from our understanding we use the proper settings and even a way higher bitrate the the default one, but the quality still lacks the sharpness you get on the same device/phone when publishing via the native Facebook app. 

What other settings/configuration changes we can make to improve the quality or is this expected due to encoding differences/codec between the native Facebook app and Ant Media?

Thanks
Lars

Ant Media Support

unread,
Aug 11, 2021, 4:08:58 PM8/11/21
to lars.s...@gmail.com, ant-medi...@googlegroups.com
Hi Lars,
​Thank you for that.
I would suggest you to change the bit-rate to something around 3Mbps and FPS to 30 in the red5-web.properties under application settings and try it.
Meanwhile I will also try to reproduce the scenarios and get back to you.
--
Best Regards,
Mohit Dubey 


 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.

On Wed, 11 Aug at 11:02 PM
, Lars Schwarz <lars.s...@gmail.com> wrote:
Hey Mohit,

Facebook recommends a video bitrate of 1,500 to 4,000 Kbps for 720p at 30fps when using their Live API, that's why we tried a maxVideoBitrateKbps of 4000 (Bandwidth parameter on the WebRTCAdaptor connector). 

When we publish to Facebook RTMP via WebRTC using Ant Media (H.264, no ABR) the resulting video quality isn't as good/sharp compared to using Facebook's native app to publish a live video. 

So from our understanding we use the proper settings and even a way higher bitrate the the default one, but the quality still lacks the sharpness you get on the same device/phone when publishing via the native Facebook app. 

What other settings/configuration changes we can make to improve the quality or is this expected due to encoding differences/codec between the native Facebook app and Ant Media?

Thanks
Lars
On Wednesday, August 11, 2021 at 9:48:15 PM UTC+2 support wrote:
Hi Lars,
Pardon me if I didn't understood your query well and feel free to correct me. But let me try to answer, the default bandwidth set for WebRTC stream in AMS is 900Kbps and FPS is at 20
You can change these parameters to suit your requirement under application settings /usr/local/antmedia/webapps/LiveApp/WEB-INF/red5-web.properties
Also, we recommend not to set bandwidth higher that 2.5Mbps in WebRTC stream so that it stays true to real time communication.
Let me know if this helps and/or if I'm missing something.

--
Cheers,
Mohit Dubey

 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.


On Wed, 11 Aug at 10:34 PM
Hey guys,

we publish to Facebook RTMP via WebRTC in 720p using a max bitrate of 4000.

If we use the native Facebook app to do the same (publish to Facebook Live) the resulting video looks much "sharper" and the audio quality also seems better. 

We use H.264 and no ABR, both videos were done on the same device and with excellent bandwidth/upload speed.

Question is: is this quality difference expected or is there any setting (on the WebRTC-side or via red5-web.properties config) that allows us to improve the quality so it matches what the native FB app produces on the same device/same resolution (720p)?

Thanks
Lars
--
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/2bfeb9e9-fbbd-4e5c-a038-40bbe2a972d8n%40googlegroups.com.
--
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.

Lars Schwarz

unread,
Aug 11, 2021, 4:19:58 PM8/11/21
to Ant Media Support, ant-medi...@googlegroups.com
Hi Mohit,

thanks. Which bit rate setting do you refer to specifically? maxBitrateAccept?
 
Our red5-web.properties config file does not seem to have any default bitrate parameter at all. 

If there is no default setting in  red5-web.properties config file, does it mean it defaults to 900 even if
we specify 4000 on the WebRTC connector side?

Is changing settings.encoding.preset to "fast" or "medium" also worth a try?

Thanks
Lars

--
Lars Schwarz
Lindenallee 29
26122 Oldenburg
Germany
T +49(0)441 36110338
M +49(0)151 1727 8127

https://about.me/larsschwarz

Ant Media Support

unread,
Aug 12, 2021, 4:23:04 AM8/12/21
to lars.s...@gmail.com, ant-medi...@googlegroups.com
Hi Lars Schwarz,
My bad. Can you please set the frame rate to 30 in settings.webRTCFrameRate. By default it is set to 20 
​You can find this under red5-web.properties 
If there is no default setting in  red5-web.properties config file, does it mean it defaults to 900 even if
we specify 4000 on the WebRTC connector side?
No it will be as per your configuration
Is changing settings.encoding.preset to "fast" or "medium" also worth a try? 
I think this is not necessary.

--
Best Regards,
Mohit Dubey
 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.

, Lars Schwarz <lars.s...@gmail.com> wrote:
--
Lars Schwarz
Lindenallee 29
26122 Oldenburg
Germany
T +49(0)441 36110338
M +49(0)151 1727 8127

https://about.me/larsschwarz

45578:1264838

lars schwarz

unread,
Aug 12, 2021, 5:29:03 AM8/12/21
to Ant Media Server
Hi Mohit,

so settings.encoding.preset is only relevant when using ABR? 

We will change the framerate and follow up here afterwards. 

Thanks
Lars

Ant Media Support

unread,
Aug 16, 2021, 2:39:39 PM8/16/21
to lars.s...@gmail.com, ant-medi...@googlegroups.com
Hi Lars Schwarz,
Did you try by changing the FPS!
Also, Encoder's preset value in adaptive bitrate Libx264 presets are there https://trac.ffmpeg.org/wiki/Encode/H.264 Ant Media Server uses "veryfast" by default 
I think changing it to medium will increase the load on the CPU but you can change it and let us know how it goes.
Looking forward to hear from you.
--
Best Regards,
Mohit Dubey


 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.

, Lars Schwarz <lars.s...@gmail.com> wrote:

Lars Schwarz

unread,
Aug 16, 2021, 2:56:48 PM8/16/21
to Ant Media Support, ant-medi...@googlegroups.com
Hi Mohit, 

We did change the framerate, but haven't tested/compared results yet.

Still unsure about the 'veryfast' encoder preset, because according to the docs it seems this is only used if Ant Media is configured to use
the Adaptive Bitrate? We also didn't find any usage reference in the source? Can you confirm that this is still used, even if we don't use
ABR?

Thanks: Lars

Ant Media Support

unread,
Aug 17, 2021, 1:03:34 PM8/17/21
to lars.s...@gmail.com, ant-medi...@googlegroups.com
Hi Lars Schwarz,
Yes, settings.encoding.preset  is only valid for ABR when the transcoding takes place in ABR.

--
Best Regards,
Mohit Dubey
 
Star Ant Media Server on GitHub and get a chance to win an AMS Annual Enterprise Edition License.

, Lars Schwarz <lars.s...@gmail.com> wrote:
, Lars Schwarz <lars.s...@gmail.com> wrote:
45578:1264838

test mis

unread,
Aug 20, 2021, 3:18:26 AM8/20/21
to Ant Media Server
Hello Team 

Please find attachment of image quality that is scratch .

Pls let us know any setting 

Screenshot_2021-08-20-12-45-40-808_com.rhythmoya.jpg

hemant bohra

unread,
Aug 22, 2021, 7:15:40 AM8/22/21
to test mis, Ant Media Server
Anyone help me with this issue?

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

Joe Suh

unread,
Oct 14, 2021, 5:36:47 PM10/14/21
to Ant Media Server
Hi Mohit and team.

We are still having video quality degradation issues, and I wonder if you can help us. 

We are broadcasting live video streams from Ant-server to Facebook but we find out the quality of that stream is not as high as when our users stream directly to Facebook without going through AntMedia.

Here is an example of one of our customers streaming via AntMedia to Facebook: https://www.facebook.com/mixedminglejewelry/videos/5047729518607552

And here's what their stream looks like when they go directly onto Facebook Live: https://www.facebook.com/mixedminglejewelry/videos/4299056140131647

It is the same phone and wifi connection in both videos. It might be hard to tell the quality difference, but here are side-by-side screenshots from the videos:

The one on the left is through AntMedia. And you can see it's not as crisp as the one on the right (user streaming directly to Facebook)

We are playing around with the Adaptive Bitrate Streaming (ex automatically adjust the resolution of video based on the user's internet speed... if internet is more than 1500 kbps video resolution, for example, we automatically adjust to 720p)

Can you make some suggestions on what else we can try to diagnose and improve the video quality? 

Thanks
Joe

Joe Suh

unread,
Oct 20, 2021, 12:51:20 AM10/20/21
to Ant Media Server
Hoping someone at AntMedia can help us with this?

Mohit Dubey

unread,
Oct 20, 2021, 2:31:11 AM10/20/21
to Ant Media Server
Hi Joe,
Let me check this and I will get back to you.
It will be great if you can provide your exact reproduce case, that will help us diagnose the case better.

--
Best Regards,
Mohit Dubey

programmer programmer

unread,
Oct 20, 2021, 6:07:53 AM10/20/21
to Joe Suh, Ant Media Server
Hi Joe
Are you using html5 canvas and capturing video streams ? If yes, then what frame rate do you capture from canvas ? like 30fps or 60 fps ?


Joe Suh

unread,
Oct 20, 2021, 8:15:28 PM10/20/21
to programmer programmer, Ant Media Server
Hi team,

We are the getting the frame rate from the videoTrack and using that, Generally it's 30 fps.

Joe

Joe Suh

unread,
Oct 22, 2021, 12:23:57 PM10/22/21
to Ant Media Server
And yes we are using html5 and canvas

Mohit Dubey

unread,
Oct 25, 2021, 6:26:04 AM10/25/21
to Ant Media Server
Hi,
Since you are using ABR, you can try by changing encoder settings and that should help you with it.

Ant Media Server is using veryfast preset that uses fewer CPU resources(disadvantage is less quality). You can change it and you can get better quality.

You can change the preset value from the config file (AMS-Folder/Application(LiveApp or etc)/WEB-INF/red5-web.properties ) with the following key.

settings.encoding.preset=

For ex: You could use medium 

Let me know if it works for you.

--
Best Regards,
Mohit Dubey

Joe S

unread,
Oct 25, 2021, 1:54:06 PM10/25/21
to Ant Media Server
Thank you Mohit. 

We will try changing the preset value and let you know!

Message has been deleted
Message has been deleted

Joe Suh

unread,
Nov 8, 2021, 5:49:16 PM11/8/21
to Ant Media Server

Hi Mohit,

Wanted to share an update. It does look like settings.encoding.preset=medium has improved the video/audio quality.


It's noticeably better. And I made a screencast to compare the two: https://youtu.be/E1CH_VeQ4Hs

Thank you so much for your help! We've been trying to improve the quality since Aug 11th. And I think we're finally seeing the improvement we were seeking!

Joe

Mohit Dubey

unread,
Nov 9, 2021, 2:34:54 AM11/9/21
to Ant Media Server
Hi Joe,
Thank you so much for writing back. 
Glad to know that it's working well :)
I'm closing this ticket now.
In case you face any issues please let us know.

--
Best Regards,
Mohit Dubey

Reply all
Reply to author
Forward
0 new messages