Question / Help Duplicate Frames from Specific Source

theinzane

Member
Hey guys, I am having a problem with OBS that I cannot figure out.

My main PC is using a 4770k and gtx 670 on my gaming PC and streaming to my secondary PC.

My secondary PC (8350fx and gtx 560) has a Virtualization of Ubuntu which is running Ngin-x with the rtmp module. I then run OBS from windows on the secondary PC and use the obs plugin to grab the video from the rtmp server and stream it to twitch.tv.

I am currently forced to use xsplit on my main PC to stream to my RTMP server because whenever I use a window capture on OBS I get duplicate frames galore. Anywhere between 10-20%. I narrowed it down to window capture because whenever I use any other sources it is fine but as soon as I add in any window sources I begin to get the duplicate frames. This happens at all encoding presets as well ranging from ultrafast to medium. Clearly the 4770k should not have problems keeping up with a 720p stream on the very fast preset.

I would prefer to use OBS on both PC's in order to stream. If I use xsplit to stream to my rtmp server I cannot go over a 14,000 bitrate. This forces me to do the downscaling on the primary PC instead of sending it to my secondary PC. Ideally I would like to stream at 1080p/60fps with quicksync or nvenc at an extremely high bitrate for lossless quality to my RTMP server then have the second PC do the downscaling to 720p and stream to twitch at about 3000 bit.

Anyways I kind of went off topic, I just need to figure out why window capture is giving me duplicate frames.

I am also using windows 8 and obs 0.60b in case you are curious.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
If possible, post a log of this particular problem (unless I'm misreading what's going on)
 

theinzane

Member
Here's the log with the sources enabled (two window captures)

Code:
17:29:55: Open Broadcaster Software v0.60b - 64bit ( ^ω^)
17:29:55: -------------------------------
17:29:55: CPU Name: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
17:29:55: CPU Speed: 3500MHz
17:29:55: Physical Memory:  16314MB Total, 10510MB Free
17:29:55: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
17:29:55: monitor 1: pos={0, 0}, size={1920, 1080}
17:29:55: monitor 2: pos={1920, 0}, size={1920, 1080}
17:29:55: Windows Version: 6.2 Build 9200 
17:29:55: Aero is Enabled
17:29:55: -------------------------------
17:29:55: OBS Modules:
17:29:55: Base Address     Module
17:29:55: 0000000016F80000 OBS.exe
17:29:55: 000000002E290000 OBSApi.dll
17:29:55: 0000000035650000 DShowPlugin.dll
17:29:55: 0000000035E20000 GraphicsCapture.dll
17:29:55: 0000000036FD0000 NoiseGate.dll
17:29:55: 0000000035980000 PSVPlugin.dll
17:29:55: ------------------------------------------
17:29:55: Adapter 1
17:29:55:   Video Adapter: NVIDIA GeForce GTX 670
17:29:55:   Video Adapter Dedicated Video Memory: 4190969856
17:29:55:   Video Adapter Shared System Memory: 4258447360
17:29:55:   Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
17:29:55:   Video Adapter Output 2: pos={1920, 0}, size={1920, 1080}, attached=true
17:29:55: ------------------------------------------
17:29:55: Adapter 2
17:29:55:   Video Adapter: NVIDIA GeForce GTX 560 
17:29:55:   Video Adapter Dedicated Video Memory: 1018753024
17:29:55:   Video Adapter Shared System Memory: 3220975616
17:29:55: Using fixed low latency mode, factor 20
17:29:55: =====Stream Start: 2014-02-11, 17:29:55===============================================
17:29:55:   Multithreaded optimizations: On
17:29:55:   Base resolution: 1920x1080
17:29:55:   Output resolution: 1920x1080
17:29:55: ------------------------------------------
17:29:55: Loading up D3D10 on NVIDIA GeForce GTX 670 (Adapter 1)...
17:29:55: ------------------------------------------
17:29:55: Audio Format: 44100hz
17:29:55: Playback device Default
17:29:55: ------------------------------------------
17:29:55: Using desktop audio input: Speakers (High Definition Audio Device)
17:29:55: ------------------------------------------
17:29:55: Using auxilary audio input: Microphone (High Definition Audio Device)
17:29:55: ------------------------------------------
17:29:55: Audio Encoding: AAC
17:29:55:     bitrate: 128
17:29:55: Using Window Capture
17:29:55: Using bitmap image
17:29:55: Using bitmap image
17:29:55: ------------------------------------------
17:29:55:     device: Logitech HD Pro Webcam C920,
17:29:55:     device id \\?\usb#vid_046d&pid_082d&mi_00#6&22453a1e&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
17:29:55:     chosen type: I420, usingFourCC: false, res: 320x180 - 320x180, frameIntervals: 333333-2000000
17:29:55:     use buffering: false - 0, fourCC: 'I420'
17:29:55:     audio device: Disable,
17:29:55:     audio device id Disabled,
17:29:55: 
17:29:55: Using directshow input
17:29:55: Using bitmap image
17:29:55: Using graphics capture
17:29:56: Scene buffering time set to 700
17:29:56: ------------------------------------------
17:29:56: Video Encoding: x264
17:29:56:     fps: 60
17:29:56:     width: 1920, height: 1080
17:29:56:     preset: ultrafast
17:29:56:     profile: main
17:29:56:     keyint: 120
17:29:56:     CBR: yes
17:29:56:     CFR: yes
17:29:56:     max bitrate: 50000
17:29:56:     buffer size: 3000
17:29:56: ------------------------------------------
17:29:56: Audio timestamp for device 'Microphone (High Definition Audio Device)' was behind target timestamp by 189163944
17:29:57:   Interface: Intel(R) Ethernet Connection I217-V (ethernet, 1000 mbps)
17:29:57: Completed handshake with rtmp://192.168.0.14/live in 2 ms.
17:29:57: SO_SNDBUF was at 65536
17:29:57: SO_SNDBUF is now 65536
17:30:02: SharedTexCapture hooked
17:32:39: Total frames encoded: 9733, total frames duplicated: 1667 (17.13%)
17:32:39: Total frames rendered: 9690, number of late frames: 49 (0.51%) (it's okay for some frames to be late)
17:32:39: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 1048576 (buffer: 0 / 6416384)
17:32:39: RTMPPublisher::SocketLoop: Graceful loop exit
17:32:39: Average send payload: 320035 bytes, average send interval: 51 ms
17:32:39: Number of times waited to send: 0, Waited for a total of 0 bytes
17:32:39: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
17:32:39: Number of bytes sent: 1004912780
17:32:39: 
17:32:39: Profiler time results:
17:32:39: 
17:32:39: ==============================================================
17:32:39: video thread frame - [100%] [avg time: 4.423 ms] [children: 91.2%] [unaccounted: 8.82%]
17:32:39: | scene->Preprocess - [15.3%] [avg time: 0.676 ms]
17:32:39: | GPU download and conversion - [75.9%] [avg time: 3.357 ms] [children: 1.2%] [unaccounted: 74.7%]
17:32:39: | | flush - [0.859%] [avg time: 0.038 ms]
17:32:39: | | CopyResource - [0.294%] [avg time: 0.013 ms]
17:32:39: | | conversion to 4:2:0 - [0.0452%] [avg time: 0.002 ms]
17:32:39: Convert444Threads - [100%] [avg time: 0.782 ms] [children: 99.5%] [unaccounted: 0.512%]
17:32:39: | Convert444toNV12 - [99.5%] [avg time: 0.778 ms]
17:32:39: encoder thread frame - [100%] [avg time: 1.119 ms]
17:32:39: ==============================================================
17:32:39: 
17:32:39: 
17:32:39: Profiler CPU results:
17:32:39: 
17:32:39: ==============================================================
17:32:39: video thread frame - [cpu time: avg 0.127 ms, total 1234.38 ms] [avg calls per frame: 1]
17:32:39: | scene->Preprocess - [cpu time: avg 0.024 ms, total 234.375 ms] [avg calls per frame: 1]
17:32:39: | GPU download and conversion - [cpu time: avg 0.035 ms, total 343.75 ms] [avg calls per frame: 1]
17:32:39: | | flush - [cpu time: avg 0.024 ms, total 234.375 ms] [avg calls per frame: 1]
17:32:39: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
17:32:39: | | conversion to 4:2:0 - [cpu time: avg 0.001 ms, total 15.625 ms] [avg calls per frame: 1]
17:32:39: Convert444Threads - [cpu time: avg 0.836 ms, total 16125 ms] [avg calls per frame: 2]
17:32:39: | Convert444toNV12 - [cpu time: avg 0.833 ms, total 16078.1 ms] [avg calls per frame: 2]
17:32:39: encoder thread frame - [cpu time: avg 0.746 ms, total 7234.38 ms] [avg calls per frame: 1]
17:32:39: ==============================================================
17:32:39: 
17:32:39: =====Stream End: 2014-02-11, 17:32:39=================================================

and here's the log with the exact same settings but the sources disabled.

Code:
17:22:31: Open Broadcaster Software v0.60b - 64bit ( ^ω^)
17:22:31: -------------------------------
17:22:31: CPU Name: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
17:22:31: CPU Speed: 3500MHz
17:22:31: Physical Memory:  16314MB Total, 10648MB Free
17:22:31: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
17:22:31: monitor 1: pos={0, 0}, size={1920, 1080}
17:22:31: monitor 2: pos={1920, 0}, size={1920, 1080}
17:22:31: Windows Version: 6.2 Build 9200 
17:22:31: Aero is Enabled
17:22:31: -------------------------------
17:22:31: OBS Modules:
17:22:31: Base Address     Module
17:22:31: 00000000A8CE0000 OBS.exe
17:22:31: 000000002E290000 OBSApi.dll
17:22:31: 0000000035650000 DShowPlugin.dll
17:22:31: 0000000035970000 GraphicsCapture.dll
17:22:31: 0000000036FD0000 NoiseGate.dll
17:22:31: 0000000035770000 PSVPlugin.dll
17:22:31: ------------------------------------------
17:22:31: Adapter 1
17:22:31:   Video Adapter: NVIDIA GeForce GTX 670
17:22:31:   Video Adapter Dedicated Video Memory: 4190969856
17:22:31:   Video Adapter Shared System Memory: 4258447360
17:22:31:   Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
17:22:31:   Video Adapter Output 2: pos={1920, 0}, size={1920, 1080}, attached=true
17:22:31: ------------------------------------------
17:22:31: Adapter 2
17:22:31:   Video Adapter: NVIDIA GeForce GTX 560 
17:22:31:   Video Adapter Dedicated Video Memory: 1018753024
17:22:31:   Video Adapter Shared System Memory: 3220975616
17:22:31: Using fixed low latency mode, factor 20
17:22:31: =====Stream Start: 2014-02-11, 17:22:31===============================================
17:22:31:   Multithreaded optimizations: On
17:22:31:   Base resolution: 1920x1080
17:22:31:   Output resolution: 1920x1080
17:22:31: ------------------------------------------
17:22:31: Loading up D3D10 on NVIDIA GeForce GTX 670 (Adapter 1)...
17:22:31: ------------------------------------------
17:22:31: Audio Format: 44100hz
17:22:31: Playback device Default
17:22:31: ------------------------------------------
17:22:31: Using desktop audio input: Speakers (High Definition Audio Device)
17:22:31: ------------------------------------------
17:22:31: Using auxilary audio input: Microphone (High Definition Audio Device)
17:22:31: ------------------------------------------
17:22:31: Audio Encoding: AAC
17:22:31:     bitrate: 128
17:22:31: Using bitmap image
17:22:31: Using bitmap image
17:22:31: ------------------------------------------
17:22:31:     device: Logitech HD Pro Webcam C920,
17:22:31:     device id \\?\usb#vid_046d&pid_082d&mi_00#6&22453a1e&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
17:22:31:     chosen type: I420, usingFourCC: false, res: 320x180 - 320x180, frameIntervals: 333333-2000000
17:22:31:     use buffering: false - 0, fourCC: 'I420'
17:22:31:     audio device: Disable,
17:22:31:     audio device id Disabled,
17:22:31: 
17:22:31: Using directshow input
17:22:31: Using bitmap image
17:22:31: Using graphics capture
17:22:31: Scene buffering time set to 700
17:22:31: ------------------------------------------
17:22:31: Video Encoding: x264
17:22:31:     fps: 60
17:22:31:     width: 1920, height: 1080
17:22:31:     preset: ultrafast
17:22:31:     profile: main
17:22:31:     keyint: 120
17:22:31:     CBR: yes
17:22:31:     CFR: yes
17:22:31:     max bitrate: 50000
17:22:31:     buffer size: 3000
17:22:31: ------------------------------------------
17:22:33:   Interface: Intel(R) Ethernet Connection I217-V (ethernet, 1000 mbps)
17:22:33: Completed handshake with rtmp://192.168.0.14/live in 2 ms.
17:22:33: SO_SNDBUF was at 65536
17:22:33: SO_SNDBUF is now 65536
17:22:34: SharedTexCapture hooked
17:23:45: Total frames encoded: 4346, total frames duplicated: 34 (0.78%)
17:23:45: Total frames rendered: 4350, number of late frames: 4 (0.09%) (it's okay for some frames to be late)
17:23:45: RTMPPublisher::SocketLoop: Graceful loop exit
17:23:45: Average send payload: 319952 bytes, average send interval: 51 ms
17:23:45: Number of times waited to send: 0, Waited for a total of 0 bytes
17:23:45: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
17:23:45: Number of bytes sent: 441853949
17:23:45: 
17:23:45: Profiler time results:
17:23:45: 
17:23:45: ==============================================================
17:23:45: video thread frame - [100%] [avg time: 0.765 ms] [children: 42%] [unaccounted: 58%]
17:23:45: | scene->Preprocess - [5.62%] [avg time: 0.043 ms]
17:23:45: | GPU download and conversion - [36.3%] [avg time: 0.278 ms] [children: 4.44%] [unaccounted: 31.9%]
17:23:45: | | flush - [3.53%] [avg time: 0.027 ms]
17:23:45: | | CopyResource - [0.784%] [avg time: 0.006 ms]
17:23:45: | | conversion to 4:2:0 - [0.131%] [avg time: 0.001 ms]
17:23:45: Convert444Threads - [100%] [avg time: 0.775 ms] [children: 99.6%] [unaccounted: 0.387%]
17:23:45: | Convert444toNV12 - [99.6%] [avg time: 0.772 ms]
17:23:45: encoder thread frame - [100%] [avg time: 1.11 ms]
17:23:45: ==============================================================
17:23:45: 
17:23:45: 
17:23:45: Profiler CPU results:
17:23:45: 
17:23:45: ==============================================================
17:23:45: video thread frame - [cpu time: avg 0.032 ms, total 140.625 ms] [avg calls per frame: 1]
17:23:45: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
17:23:45: | GPU download and conversion - [cpu time: avg 0.003 ms, total 15.625 ms] [avg calls per frame: 1]
17:23:45: | | flush - [cpu time: avg 0.003 ms, total 15.625 ms] [avg calls per frame: 1]
17:23:45: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
17:23:45: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
17:23:45: Convert444Threads - [cpu time: avg 0.902 ms, total 7765.63 ms] [avg calls per frame: 2]
17:23:45: | Convert444toNV12 - [cpu time: avg 0.899 ms, total 7734.38 ms] [avg calls per frame: 2]
17:23:45: encoder thread frame - [cpu time: avg 0.762 ms, total 3281.25 ms] [avg calls per frame: 1]
17:23:45: ==============================================================
17:23:45: 
17:23:45: =====Stream End: 2014-02-11, 17:23:45=================================================

I know both streams are very short but these are from my short tests to isolate the problem. If I let the stream go for 5 minutes or 1 hour the amount of frames duplicated remain approximately the same.

I would love to use OBS to stream to my RTMP server again but 10%+ frame duplication is unacceptable and makes the stream frame rate look very inconsistent.

**edit**

I should also note that it's not a specific window capture, if I use one or the other the duplicate frame % is cut half so either window capture is causing OBS to duplicate frames.

Also I tried completely removing the sources and re-adding them and still ended up with the same results. I use chroma keys with both sources as well. I tried just running the window captures without applying the chroma key to see if that was causing the issue but it had no affect on the amount of duplicated frames.
 

Boildown

Active Member
You're using 50000 bitrate with 3000 buffer. I haven't tried anything like that personally, but it sounds really really bad. Try 25000/25000, then tweak from there. If 25000/25000 has the same problem, do it anyways for at least five minutes and post the log file.
 

theinzane

Member
It happens no matter what bitrate I use. The bitrate isn't the issue otherwise the duplicate frames would happen all the time.
 

Boildown

Active Member
Humor me and do what I suggested anyways. Its part of the troubleshooting process. Otherwise I'll have no further suggestions.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
It seems like there's graphics card stalls. I think this could be related to the fact that you have two different video cards in your computer. It's not the first time it's happened in that particular case. It may depend on what's on what monitor when you're capturing, I'm not entirely sure unfortunately. Try out "compatibility mode" in window capture as well, and see if it makes any difference. Otherwise, not entirely sure, but I am eyeing those two different adapters.
 

PrinceVinc

Member
Digging this up and have to say nope, I have the same issue right now when I use Window Capture while trying to record Elsword (Game Capture doesn't work.)
Both of my Monitors are connected to the same GPU. (The Game Capture duplications are gone it seems)
Still get Duplicated frames in Window Capture.
Well its not 10-20% but above 5%
https://gist.github.com/anonymous/9ba0b3962ea2c6121c6a
 
Last edited:
Top