ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.23k stars 618 forks source link

Pulled RTMP Endpoint resolution is constant in 480p #2332

Open SelimEmre opened 4 years ago

SelimEmre commented 4 years ago

Short description

Here is scenario: Add RTMP Endpoint in WebRTC Stream. Check added RTMP Endpoint resolution value with ffprobe. You can see the resolution is 640x480. I tried different cases and I encountered this issue always.

Steps to reproduce

  1. Add 2 stream which is testStream1 and testStream2
  2. Add testStream2 RTMP Endpoint in testStream1.
  3. Publish WebRTC Stream in testStream1
  4. Check testStream2 resolution parameter with ffprobe.
  5. You can see 640x480 parameters

Expected behavior

If we send 1080p with WebRTC, RTMP Endpoint should have a 1080p resolution.

Actual behavior

RTMP Endpoint resolution 480p is fixed at whatever resolution I send it with WebRTC.

Logs

AMS 2.1 SNAPSHOT I'm using default settings.

FFprobe output:

Input #0, flv, from 'rtmp://domain.com/WebRTCAppEE/4OaT5dGcK2Vu1594936913510':
  Metadata:
    encoder         : Lavf58.20.100
    length          : 12
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 640x480, 1k tbr, 1k tbn
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 96 kb/s
mekya commented 4 years ago

Thank you for your question.

WebRTC changes the resolution according to the bandwidth. Opening camera with 1080 does not mean that WebRTC send stream with 1080p. It adapts the resolution according to the bandwidth and it can even send lower than 480p.

Btw, according to the webrtc standards, there are some more settings coming that gives more options to developer to maintain resolution or frame rate.

ghost commented 4 years ago

It adapts the resolution according to the bandwidth and it can even send lower than 480p. - I have 20 MBPS internet speed even after antmedia sending 480P to you tube.

mekya commented 4 years ago

Thank you for your comment.

TL;DR;

Let me point out some more things for enthusiasts

ghost commented 4 years ago

Okay.. I got it but the thing is when i start the streaming through out whole process it look like same there is no change in resolution even i am setting resolution to 1080 it's always taking lower level resolution.

Can you please help into that I having big issue in my live application where thousand of users are there.

mekya commented 3 years ago

Sorry for late reply.

It's something about browser side. It decides which resolution to send. The resolution may increase over the time but the browser decides that

You can google about that for having fixed and high quality in browser for WebRTC streaming. Maybe I'm or we're missing somethings