Question / Help Bad, chopping, freezing stream HELP

davidd22

New Member
I've setup my own rtmp server (https://obsproject.com/forum/viewtopic.php?f=18&t=2651). It's working, I can see the stream. But the stream is unwatchable. First few seconds are OK, but then its freezing for 10s (more or less). I'm streaming from a laptop (HP pavilion, quad core 1,6+dual graphics). The OBS doesen't report any problem, frames aren't droping but the stream is really bad. My connection is 10/20Mbps. Here is my log:

Open Broadcaster Software v0.48.007b (experimental test build) - 64bit ( ^ω^)
-------------------------------
CPU Name: AMD A6-3410MX APU with Radeon(tm) HD Graphics
CPU Speed: 1597MHz
Physical Memory: 3562MB Total, 1811MB Free
stepping id: 0, model 1, family 15, type 0, extmodel 8, extfamily 1, HTT 1, logical cores 4, total cores 4
monitor 1: pos={0, 0}, size={1600, 900}
Windows Version: 6.1 Build 7601 S
Aero is Disabled
------------------------------------------
Adapter 1
Video Adapter: AMD Radeon HD 6520G
Video Adapter Dedicated Video Memory: 1583030272
Video Adapter Shared System Memory: 1599551488
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: no
CFR: no
max bitrate: 2000
buffer size: 2000
quality: 6
------------------------------------------
Using Window Capture
Total frames rendered: 1020, number of frames that lagged: 6 (0.59%) (it's okay for some frames to lag)
Total duplicated frames: 13 (1.27%)
=====Stream End=======================================================================
Using automatic low latency mode
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: no
CFR: no
max bitrate: 2000
buffer size: 2000
quality: 6
------------------------------------------
SO_SNDBUF was at 8192
SO_SNDBUF is now 65536
Total frames rendered: 10153, number of frames that lagged: 306 (3.01%) (it's okay for some frames to lag)
Total duplicated frames: 357 (3.52%)
RTMPPublisher::SocketLoop: Aborting due to bStopping
Number of times waited to send: 10, Waited for a total of 38316 bytes
Number of b-frames dropped: 33 (0.33%), Number of p-frames dropped: 35 (0.35%), Total 68 (0.67%)
=====Stream End=======================================================================
Using automatic low latency mode
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: yes
CFR: no
max bitrate: 2000
------------------------------------------
SO_SNDBUF was at 8192
SO_SNDBUF is now 65536
Total frames rendered: 771, number of frames that lagged: 1 (0.13%) (it's okay for some frames to lag)
Total duplicated frames: 0 (0.00%)
okay, this is strange
RTMPPublisher::SocketLoop: Aborting due to loop exit
librtmp error: WriteN, RTMP send error 10035 (39 bytes)
librtmp error: WriteN, RTMP send error 10038 (42 bytes)
Number of times waited to send: 2, Waited for a total of 8200 bytes
Number of b-frames dropped: 34 (5.3%), Number of p-frames dropped: 34 (5.3%), Total 68 (11%)
=====Stream End=======================================================================
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: no
CFR: no
max bitrate: 2000
buffer size: 2000
quality: 6
------------------------------------------
Total frames rendered: 168, number of frames that lagged: 1 (0.60%) (it's okay for some frames to lag)
Total duplicated frames: 0 (0.00%)
=====Stream End=======================================================================
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: no
CFR: no
max bitrate: 2000
buffer size: 2000
quality: 6
------------------------------------------
Total frames rendered: 1588, number of frames that lagged: 25 (1.57%) (it's okay for some frames to lag)
Total duplicated frames: 4 (0.25%)
=====Stream End=======================================================================
Using automatic low latency mode
=====Stream Start=====================================================================
Multithreaded optimizations: On
Base resolution: 1600x900
Output resolution: 912x514
------------------------------------------
Loading up D3D10...
Playback device Default
------------------------------------------
Using desktop audio input: Speakers and Headphones (IDT High Definition Audio CODEC)
------------------------------------------
Audio Encoding: AAC
bitrate: 128
Using Window Capture
------------------------------------------
Video Encoding: x264
fps: 45
width: 912, height: 514
preset: veryfast
CBR: no
CFR: yes
max bitrate: 2000
buffer size: 2000
quality: 6
------------------------------------------
SO_SNDBUF was at 8192
SO_SNDBUF is now 65536
Total frames rendered: 2198, number of frames that lagged: 4 (0.18%) (it's okay for some frames to lag)
Total duplicated frames: 0 (0.00%)
RTMPPublisher::SocketLoop: Aborting due to bStopping
Number of times waited to send: 0, Waited for a total of 0 bytes
Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
=====Stream End=======================================================================

Profiler results:

==============================================================
frame - [100%] [avg time: 11.106 ms] [avg calls per frame: 1] [children: 92.8%] [unaccounted: 7.24%]
| scene->Preprocess - [72.8%] [avg time: 8.08 ms] [avg calls per frame: 1]
| video encoding and uploading - [20%] [avg time: 2.222 ms] [avg calls per frame: 1] [children: 19.1%] [unaccounted: 0.918%]
| | CopyResource - [1.41%] [avg time: 0.157 ms] [avg calls per frame: 0]
| | conversion to 4:2:0 - [0.126%] [avg time: 0.014 ms] [avg calls per frame: 0]
| | call to encoder - [17.3%] [avg time: 1.923 ms] [avg calls per frame: 1]
| | sending stuff out - [0.234%] [avg time: 0.026 ms] [avg calls per frame: 1]
==============================================================
 

davidd22

New Member
Thans for your reply.

Server is located in germany. The ping is 30ms. I'm watching from diffrent pc using vlc...
 

dodgepong

Administrator
Community Helper
Well, it appears you're not dropping any frames, so as far as I can tell, you're streaming to it OK. The problem must lie somewhere in the connection between you and the server as you are downloading it. I'll be honest, I'm not sure what would cause that.

Here's something you can try: If you have a Twitch account, add the following to your nginx.conf under the "application live" section and restart nginx:

push rtmp://live-ams.twitch.tv/app/<your twitch stream key>

Then when you stream to your RTMP server, it will forward on the stream to your Twitch channel. Then try watching it on Twitch to see if it has the same problems. I don't know how reliable VLC with RTMPDump is as an RTMP viewer :/
 

davidd22

New Member
I'm not trying to stream to twitch, i would like to pick up the stream with my iPad (pro tv app), currently I'm getting the stream but as I said, first few seconds are OK but than it is unwatchable. I would really like to get min delay and consistent sream in about 514p.
 

hilalpro

Member
Leave them off for now, does steaming directly to public ingest servers such as twitch's give you this frame drop issue ?
 

davidd22

New Member
When I tried to stream to twitch servers, there was just a black screen, but streams ware saved on the site and it was ok. But could not see them live...
 

hilalpro

Member
Ok so first you need to get your frame time down, enable aero from settings>video then restart obs and pick a transparent windows theme.

To solve the frame drop issue you need to check and see if your upload connection is not getting badly shaped ( could still be only shaped for some protocols though) use a program called shaperprobe and post the results.
 

davidd22

New Member
DiffProbe release. January 2012. Build 1008.
Shaper Detection Module.

Connected to server 213.244.128.168.

Estimating capacity:
Upstream: 1632 Kbps.
Downstream: 9839 Kbps.

The measurement will take upto 2.5 minutes. Please wait.

Checking for traffic shapers:

Upstream: No shaper detected.
Median received rate: 1605 Kbps.

Downstream: Burst size: 5328-5742 KB;
Shaping rate: 37 Kbps.

For more information, visit: http://www.cc.gatech.edu/~partha/diffprobe
 

hilalpro

Member
Now it make sense. lower the bitrate and bufsize to about 1200 or less to see if it works since you'll also be watching your stream.
 

davidd22

New Member
DiffProbe release. January 2012. Build 1008.
Shaper Detection Module.

Connected to server 213.244.128.138.

Estimating capacity:
Upstream: 4596 Kbps.
Downstream: 9845 Kbps.

The measurement will take upto 2.5 minutes. Please wait.

Checking for traffic shapers:

Upstream: No shaper detected.
Median received rate: 4517 Kbps.

Downstream: Burst size: 3672-4034 KB;
Shaping rate: 112 Kbps.

For more information, visit: http://www.cc.gatech.edu/~partha/diffprobe
 

dodgepong

Administrator
Community Helper
davidd22 said:
I'm not trying to stream to twitch, i would like to pick up the stream with my iPad (pro tv app), currently I'm getting the stream but as I said, first few seconds are OK but than it is unwatchable. I would really like to get min delay and consistent sream in about 514p.
I know you're not trying to stream to Twitch, but I wanted to see if the performance was any better using a different client to watch the stream besides VLC. By forwarding the stream to Twitch, you would be able to better find out where the problem lay.
 

davidd22

New Member
I think I solved it; it was the wifi conection. Now I plugged pc in modem and it is constant and steady. Thanks for all your replies. I didn't know it such a differnce in upload between wifi and cable....
 

davidd22

New Member
Now i would like to ask if someone can give me the best settings for minimum delay..currently getting 4s...
 

davidd22

New Member
So, if anybody would be so kind, to give me some advice (settings) for streaming in 912x514 with min possible delay. I know you (Dodgepong) were able to get it around 1s.
 

dodgepong

Administrator
Community Helper
I was able to get it to 1 second using OBS 473 or later (test versions). Those versions had a lot of buffering removed, so it was faster. That's the only thing I did. If you're using the latest test version and still have a lot of delay, then I don't know what to say. There will always be at least some delay in streaming depending on the server and your connection quality.
 

davidd22

New Member
Could you just post the settings or the log, if you could (which boxes to check etc.)? Thanks for all your replies.
 
Top