Many troubles with live stream playback are caused by dropped frames. We’ll go over some of the most common causes of missing frames in OBS in this article, but the majority of the advice can be applied to any live stream encoder.
There are two ways to determine whether or not your stream is dropping frames. If viewers are complaining about a stuttering live stream, the first option is to use it. This could be a problem with the live stream platform you’re using, or it could be a problem on your end.
The second method is to look at OBS itself. When you’re broadcasting a live stream, you can check the status of the stream and see if it’s dropping frames at the bottom of the OBS window.
What is Frame drop in Streaming OBS?
Audio and video frames are created by your streaming application. It compresses them and then sends them out according to the framerate you’ve selected for your software. It uses a unique function named “send” for each video/audio packet that is compressed when it is formed to send them out. This “send” function is a socket function built into the operating system (it’s a Microsoft/Apple/Linux function, not one written by your streaming program). If your connection is in good working order, the “send” feature will complete almost instantly. There will also be no frame drops.
If that “send” operation isn’t completed in time (due to any form of network congestion), the audio or video packets you’re trying to send will begin to accumulate in a queue, waiting for the right opportunity to send them. Meanwhile, you’re encoding data at whatever frames per second you choose. And you can’t just sit there and wait for the process to finish until the memory is depleted, at which point something has to be sacrificed. When they reach a precise point (about 700 milliseconds of backup data), the phenomenon known as “dropping frames” occurs, in which you are compelled to drop video frames in order to clear the buffered packet queue. As a result, your stream may experience what appears to be video stuttering.
In the event of sporadic internet congestion, the ability to discard frames in response to a certain quantity of traffic is critical for stream stability and latency reduction.
What role does it play in maintaining stability?
- If it did not, in the event of sudden congestion, it may create bursting as all the backed-up packets attempt to be sent out once the congestion is gone, resulting in a drop in network stability and possibly an increase in network instability.
- This will wait for audio or video packets to be uploaded until you run out of memory if there is persistent congestion (i.e. you have set the bitrate higher than what your upload can maintain at a steady rate). This is something that needs to be avoided.
What is the significance of latency?
- Let’s assume that in the event of spontaneous congestion, it goes back for 5 seconds. Your viewers would be delayed by many seconds if there were no frame dropouts. This happens almost every time you’re stuck in traffic.
- When there is persistent congestion, the content that viewers see is constantly delayed, making it less of a live streaming experience. This, as well as the memory issue caused by the growing size of the queue of packets containing compressed video and audio data.
After roughly 700 milliseconds of backed-up audio/video data, the system decides to start discarding frames in order to ensure network stability and reduce latency. It would be more prone to congestion if it was less than that. It tries to keep the number at a manageable level since if it was greater, it might cause difficulties with latency or stream delay.
If that happens frequently, it’s usually a sign that your bitrate is too high for you to keep up with on a consistent basis.
A fault or defect in the program, or a glitch in the application, does not cause frame drops. They occur as a result of the program’s use of the “send” function. When the “send” function is called by the application. Because the function is too slow, the queued audio/video files pile up, waiting to be sent out, to the point where they must be divided to assure stream latency and stability.
It’s just a result of network congestion. Aside from network congestion, streaming software does not lose frames for any other reason.
What causes network congestion and how can it be avoided?
The most common causes are an unstable connection to the server, a bad or unstable ISP, and a connection with an ISP; in less common cases, it could be a router or modem issue. It could be a distinct system issue or a few highly odd networks or drivers in exceedingly uncommon cases.
Dropped frames can be caused by a variety of factors:-
Pay attention to the words “keep with steadiness” above. As noted in the previous paragraph, the pace at which you transmit audio or video packets should be constant and consistent to ensure latency and additional stability. This does not mean that your internet connection can’t upload at a quicker rate; rather, it means that it can’t upload at a defined rate while being stable. It is possible to have 30mb/s while maintaining a consistent pace of 3mb/s. Streaming software must be able to upload content at a steady, stable rate, or else there may be congestion, resulting in frame drops.
The following are some possible causes of dropped frames:-
- The firewall/anti-virus/security software on your machine is interfering with the connection.
- You’re behind a firewall or proxy that limits the upload speed of your connection.
- Your router is sluggish, outdated, malfunctioning, or incorrectly configured.
- Someone or something else on your network is consuming a lot of your upload bandwidth. Consider the following scenario:
- A huge file is being uploaded.
- On your network, torrents are being actively seeded.
- Someone else is watching.
Quick Fixes to FPS Drop while streaming OBS:-
1. Reduce your stream’s resolution:
The higher the stream resolution, the more CPU is used in general. Frame drops may be reduced by reducing the resolution to a lesser size.
You can also try turning on hardware encoding if you have a recent Nvidia graphics card. The majority of the processing is now handled by the GPU.
2. Lower the bitrates of your streams:
You may suffer stuttering if your upload bandwidth isn’t properly suited to your bitrate. This occurs because OBS is unable to keep the stated bitrate and will change it frequently. Any jumps in bitrate will almost always cause stuttering, so select a bitrate that you can stream continuously.
3. If you’re streaming live video over WiFi, try using an ethernet cable instead:
Because the signal strength changes continually during the stream, live streaming over WiFi can be quite problematic. Using an ethernet wire connected directly to the modem, try streaming a live stream. If this resolves the frame drops, you are most likely experiencing WiFi troubles.
If WiFi is your only choice, use an app like ‘WiFi Analyzer’ for Android to find the least congested WiFi channel. Make sure your WiFi channel isn’t set to ‘Auto’ as well.
4. Check your firewall settings:
Firewalls may be blocking the port required for RTMP in some circumstances. Make that TCP port 1935 is open for outgoing traffic.
5. Broadcast to a server that is closest to you:
You can probably broadcast to a variety of servers in different places, depending on the live streaming platform you’re utilizing. In general, it’s ideal to stream to a server that’s nearest to your location geographically.
6. Enable network optimizations:
OBS uses an event-based API instead of non-blocking sockets when the network optimizations feature is enabled. While this should function in the same way as conventional network code, some users have observed that it aids in the resolution of dropped frames or disconnection issues. The network optimizations code also provides thorough network event logging, which can be useful for sending a log file.
Only on Windows, go to Settings -> Advanced -> Network and enable network optimizations by clicking Enable network optimizations.