+00 (1) 530 803 8307

Recommended Encoding For RTMP Server Settings

Guidelines for a successful live stream

Real-Time Messaging Protocol (RTMP) is as it says a protocol for transmitting media, like videos, and images, through the internet. This technology enables live video streaming over your browser, just like the other main protocol HTML which is used for websites.

Red5 Server advises providing a single HD stream at 720p resolution with the following parameters for the majority of applications:

QualityResolutionVideo BitrateAudio BitrateFrames Per SecondVideo Codech.264 ProfileAudio CodecAudio Channels
SD 7201280×720640kbps64kbps30h.264MainAACMono or Stereo
rtmp settings

Full HD 1080P and 4K broadcasts need much more processing power and bandwidth for encoding, not just from the server but also from your computer or smartphone. Actually, you should only broadcast at lower bitrates to your mobile device; if you want to stream at greater bitrates, make sure your computer has at least 8 GB of RAM and a modern CPU.

You use these resolutions when you are convinced to have the resources to correctly encode and deliver without quality loss. Lack of encoding resources or bandwidth might result in poor image quality and interrupted or damaged viewing or recording when greater resolutions and bitrates are attempted.

In the charts below, if we mention 4K streaming, we advise contacting us for a customized package. You might need us to build a fully dedicated server exclusively for you. Depending on how many viewers you anticipate, we may need to set up the server with a 20–30gbps port.

QualityResolutionVideo BitrateAudio BitrateFrames Per SecondVideo Codech.264 ProfileAudio CodecAudio Channels
HD 7201280×7201,024 – 3,072 kbps128kbps25/30/60h.264MainAACMono or Stereo
HD 10801920×10804,000-8,000 kbps192kbps25/30/60h.264Main or HighAACStereo
4K3840×21608,000-14,000 kbps192kbps25/30h.264HighAACStereo

Setting the Local Transcoding Mode

You may select lower or higher resolutions and bitrates depending on your video production workflow, encoding hardware, available bandwidth, and the package for the streaming server you purchased from Red5 Server. The recommended setups for various bitrates and resolutions are listed in the table below.

QualityResolutionVideo BitrateAudio BitrateFrames Per SecondVideo Codech.264 ProfileAudio CodecAudio Channels
Low480×270400kbps64kbps25 / 30h.264BaselineAACMono
Med640×360800 – 1024 kbps96kbps25 / 30h.264MainAACMono or Stereo
High960×540 / 854×4801024 – 1500 kbps96kbps25 / 30h.264MainAACMono or Stereo
HD 7201280×7201,500 – 3,072 kbps128kbps25 / 30h.264MainAACMono or Stereo
HD 10801920×10804,000-4,500 kbps192kbps25 / 30h.264Main or HighAACStereo
4K3840×21608,000-14,000 kbps192kbps25 / 30h.264HighAACStereo

Video Resolution

  • We recommend streaming at a resolution with a 16:9 aspect ratio as listed above
  • It is best to either match your original video source or scale it down. For example, capture at HD 720 and stream at HD 720. Or capture at HD 720 and stream at 540 (high).
  • You should never be scaling up and streaming at a higher resolution than your original video source. For example, it does not make sense to capture at 720 and stream at 1080. You will have no gain in quality and you are using more bandwidth than is necessary for you and your viewers.
  • Be aware that higher resolutions require greater processing power to encode the stream. Attempting too high of a resolution on too little processing power can result in degraded image quality and corrupted or interrupted streams or recordings.

Video Bitrate

  • Many popular encoders on the market use variable bitrate encoding. With a variable bitrate encoder, when you set a bitrate, you are only setting a target. Depending on the level of motion in your video content and your keyframe interval, the actually encoded bitrate of the stream will go higher and lower than the target. This is one of the reasons why having adequate headroom in your bandwidth is so important.
  • Higher motion content requires a higher bitrate to achieve the same perceived quality video stream. For example, “talking heads” sitting at a desk with a relatively static shot can use the lower end of the bitrate recommendations provided above, whereas a sporting event or concert with high motion and many moving cameras will typically require a significantly higher bitrate at the same resolution to have the same perceived quality.
  • Higher resolutions require a higher bitrate to achieve the same perceived quality video stream. It is important that you use the guidelines provided in the chart above to appropriately match your bitrate to the resolution you are using. Using too high or low of a bitrate can lead to poor image quality or buffering for your viewers.
  • If your available bandwidth is limited, you should reduce both your resolution and your bitrate accordingly.

Audio Bitrate

  • The audio bits take up much less of the overall bandwidth than your video bitrate. In addition, the perceived quality gain at bitrates above 320kbps is minimal, so it is recommended to keep the audio bitrates within the ranges suggested above.

Frame Rate

Frame rates should always match the frame rate of the video source.

NTSC standard equipment typically operates at 30 fps and in that case, encoding parameters should be configured to match the source frame rate of 30 fps.

PAL standard equipment typically operates at 25 fps and in that case, encoding parameters should be configured to match the source frame rate of 25 fps.

HFR video imposes additional stress on player devices. Lower-end devices such as certain laptops or smartphones could stutter or crash when playing HFR video. Therefore, many end users viewing on typical computers and mobile devices will not be able to properly decode 60 FPS streams and this can result in playback issues.

Video Codec

  • Red5 Server recommends h.264 and AAC. These are the most widely compatible and efficient modern codecs. They offer the highest quality at the lowest bitrates.

h.264 Profiles

  • Red5 Server supports the H.264 profiles MAIN and HIGH. See the table above for resolution suitability

Audio Codec

  • AAC must be used for full compatibility with the HTML5 streaming players

Internet connection recommendations

  • For successful live streaming, you need a high-quality internet connection. A connection that is sufficient to check email or load web pages may not be good enough for streaming. You don’t need “a” internet connection, you need a high-quality internet connection, particularly to do uninterrupted HD streaming.
  • Not all connections are of the same quality. You want to use a wired ethernet connection and not use WiFi as WiFi connections are more prone to fluctuation in quality and can more easily drop.
  • Cellular (3G/4G/LTE) connections can be very unreliable. It is strongly recommended to use a hardwired ethernet connection or a WiFi connection over a cellular connection. But the type of connection is only one factor. For every type of connection, it is important to conduct bandwidth tests ahead of time to know you have sufficient bandwidth to stream.
  • It is important to use a connection that is not shared with many other users. For example, when streaming from a typical corporate office or event venue, the amount of bandwidth available for your stream may be inconsistent depending on the number of other users on the same network.
  • It is recommended to ask your IT department to dedicate bandwidth that is reserved solely for the stream. If you have plenty of bandwidth and not many users sharing the same bandwidth, this may not be necessary. But if you find you are on a shared connection and cannot always get adequate bandwidth, you may want to ask for this, or to try to minimize how many other users are on the same connection at the time of your stream.
  • If you are not on a corporate network or do not have an IT department to contact, you can check with your internet service provider to purchase a plan that has the appropriate level of service for streaming.

Network Bandwidth

  • When choosing your encoding settings you should take into account your available upload bandwidth.
  • A good rule of thumb is for the bitrate of your stream to use no more than 50% of your available upload bandwidth capacity on a dedicated line. For example, if the result you get from a speed test shows that you have 2Mbps of upload speed available, your combined audio and video bitrate should not exceed 1Mbps.
  • To stream in HD, you’ll want at least 3-8Mbps upload speeds available
  • a generic speed test, such as the one at speedtest.net, should suffice to measure available bandwidth
  • If you find that your stream frequently rebuffers, pauses, or disconnects, try using a lower bitrate and resolution on your encoder.

Encoder Hardware Recommendations

CPU Resources

  • Ensure your encoding CPU / GPU can handle your encoding settings.
  • HD streams and high bitrate streams take significantly more CPU and GPU resources to capture and encode.
  • If your streams are choppy, pause and resume, exhibit encoding artifacts, are dropping frames, or appear to be playing back at a lower-than-expected frame rate, these can all be signs that your CPU is not able to keep up with the live video encoding.
  • Reducing the input resolution size and or reducing your stream output resolution and bitrate can fix these issues.
  • Most encoders have an indicator to show you how much of your available resources you are using. Pay attention to this and lower your settings accordingly if it shows you are nearing the maximum resources available.
  • Low frame rate streams look very bad. Unless you have extremely low motion content like static slide images, often it would be better to stream full frame rate at a reduced resolution, for example, 640×360 at 30fps vs 720HD but only being able to stream at 12 frames per second.