Question / Help x264 settings with Ryzen 7 as Dedicated Streaming PC

Linten

New Member
Hey guys my ryzen7 2700x is only on 60-80% load if i try 900p60fps, 8500bitrate,x264 slow preset. but the stream is laging bad and obs has no dropped frames or FPS drops. It is a Dedicated Streaming rig with 16gb ddr4 3200 and an Asus strix gtx1070 connection: cable 200down/50up
 

Chrisseli

New Member
Maybe post a log file, that will tell us a bit more. I could be because of your capture devices or your internetconnection,
 

Linten

New Member
now OBS says that the encoder is overloaded but the cpu is still at max 85% overall in Task Manager

10:09:46.989: CPU Name: AMD Ryzen 7 2700X Eight-Core Processor
10:09:46.989: CPU Speed: 3900MHz
10:09:46.989: Physical Cores: 8, Logical Cores: 16
10:09:46.989: Physical Memory: 16315MB Total, 12952MB Free
10:09:46.989: Windows Version: 10.0 Build 17763 (revision: 195; 64-bit)
10:09:46.989: Running as administrator: true
10:09:46.989: Aero is Enabled (Aero is always on for windows 8 and above)
10:09:46.989: Windows 10 Gaming Features:
10:09:46.989: Game DVR: On
10:09:46.990: Sec. Software Status:
10:09:46.991: Windows Defender Antivirus: enabled (AV)
10:09:46.991: Windows-Firewall: enabled (FW)
10:09:46.991: Windows Defender Antivirus: enabled (ASW)
10:09:46.993: Browser Hardware Acceleration: true
10:09:46.993: Portable mode: false
10:09:47.124: OBS 22.0.2 (64-bit, windows)
10:09:47.124: ---------------------------------
10:09:47.125: ---------------------------------
10:09:47.125: audio settings reset:
10:09:47.125: samples per sec: 44100
10:09:47.125: speakers: 2
10:09:47.136: ---------------------------------
10:09:47.136: Initializing D3D11...
10:09:47.136: Available Video Adapters:
10:09:47.137: Adapter 1: NVIDIA GeForce GTX 1070
10:09:47.137: Dedicated VRAM: 4185915392
10:09:47.137: Shared VRAM: 4259241984
10:09:47.137: output 1: pos={0, 0}, size={1920, 1080}, attached=true
10:09:47.139: Loading up D3D11 on adapter NVIDIA GeForce GTX 1070 (0)
10:09:47.181: D3D11 loaded successfully, feature level used: 45056
10:09:47.815: ---------------------------------
10:09:47.815: video settings reset:
10:09:47.815: base resolution: 1920x1080
10:09:47.815: output resolution: 1600x900
10:09:47.815: downscale filter: Lanczos
10:09:47.815: fps: 60/1
10:09:47.815: format: NV12
10:09:47.815: YUV mode: 601/Partial
10:09:47.817: Audio monitoring device:
10:09:47.817: name: Standard
10:09:47.817: id: default
10:09:47.817: ---------------------------------
10:09:47.862: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/chrome_elf.dll' not found, loading of module failed
10:09:47.867: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
10:09:47.922: [AMF] AMF Test failed due to one or more errors.
10:09:47.922: Failed to initialize module 'enc-amf.dll'
10:09:48.047: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libcef.dll' not found, loading of module failed
10:09:48.063: LoadLibrary failed for '../../obs-plugins/64bit/libEGL.dll': (null) (127)
10:09:48.063: Module '../../obs-plugins/64bit/libEGL.dll' not loaded
10:09:48.091: Required module function 'obs_module_load' in module '../../obs-plugins/64bit/libGLESv2.dll' not found, loading of module failed
10:09:48.124: [obs-browser]: Version 2.1.5
10:09:48.153: NVENC supported
10:09:48.307: Couldn't find VLC installation, VLC video source disabled
10:09:48.330: No blackmagic support
10:09:48.352: ---------------------------------
10:09:48.352: Loaded Modules:
10:09:48.352: win-wasapi.dll
10:09:48.352: win-mf.dll
10:09:48.352: win-dshow.dll
10:09:48.352: win-decklink.dll
10:09:48.352: win-capture.dll
10:09:48.352: vlc-video.dll
10:09:48.352: text-freetype2.dll
10:09:48.352: rtmp-services.dll
10:09:48.352: obs-x264.dll
10:09:48.352: obs-vst.dll
10:09:48.352: obs-transitions.dll
10:09:48.352: obs-text.dll
10:09:48.352: obs-qsv11.dll
10:09:48.352: obs-outputs.dll
10:09:48.352: obs-filters.dll
10:09:48.352: obs-ffmpeg.dll
10:09:48.352: obs-browser.dll
10:09:48.352: image-source.dll
10:09:48.352: frontend-tools.dll
10:09:48.352: enc-amf.dll
10:09:48.352: coreaudio-encoder.dll
10:09:48.352: ---------------------------------
10:09:48.353: ==== Startup complete ===============================================
10:09:48.361: All scene data cleared
10:09:48.361: ------------------------------------------------
10:09:48.392: WASAPI: Device 'Lautsprecher (Elgato Sound Capture)' initialized
10:09:48.409: WASAPI: Device 'Eingang (BEHRINGER USB WDM AUDIO 2.8.40)' initialized
10:09:48.410: Switched to scene 'Szene'
10:09:48.410: ------------------------------------------------
10:09:48.410: Loaded scenes:
10:09:48.410: - scene 'Szene':
10:09:48.410: - source: 'Videoaufnahmegerät' (dshow_input)
10:09:48.410: ------------------------------------------------
10:09:48.456: CalculateFileHash: Failed to open file 'C:\Users\Tobia\AppData\Roaming\obs-studio\updates\whatsnew.json':
10:09:48.456: adding 46 milliseconds of audio buffering, total audio buffering is now 46 milliseconds
10:09:49.382: ---------------------------------
10:09:49.382: [DShow Device: 'Videoaufnahmegerät'] settings updated:
10:09:49.382: video device: Elgato Game Capture HD
10:09:49.382: video path: __elgato
10:09:49.382: resolution: 1920x1080
10:09:49.382: fps: 60.00 (interval: 166666)
10:09:49.382: format: UYVY
10:09:49.382: using video device audio: yes
10:09:49.382: sample rate: 48000
10:09:49.382: channels: 2
10:09:49.382: audio type: Capture
10:09:50.556: adding 208 milliseconds of audio buffering, total audio buffering is now 255 milliseconds
10:10:27.486: Settings changed (outputs)
10:10:27.486: ------------------------------------------------
10:11:34.068: ---------------------------------
10:11:34.068: [x264 encoder: 'streaming_h264'] preset: slow
10:11:34.068: [x264 encoder: 'streaming_h264'] profile: high
10:11:34.069: [x264 encoder: 'streaming_h264'] settings:
10:11:34.069: rate_control: CBR
10:11:34.069: bitrate: 8500
10:11:34.069: buffer size: 8500
10:11:34.069: crf: 0
10:11:34.069: fps_num: 60
10:11:34.069: fps_den: 1
10:11:34.069: width: 1600
10:11:34.069: height: 900
10:11:34.069: keyint: 120
10:11:34.069:
10:11:34.079: ---------------------------------
10:11:34.081: [FFmpeg aac encoder: 'Track1'] bitrate: 160, channels: 2, channel_layout: 3
10:11:34.081:
10:11:34.086: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://de.castr.io/static...
10:11:34.132: [rtmp stream: 'adv_stream'] Interface: Intel(R) I211 Gigabit Network Connection (ethernet, 1000 mbps)
10:11:34.233: HandShake: client signature does not match!
10:11:34.535: [rtmp stream: 'adv_stream'] Connection to rtmp://de.castr.io/static successful
10:11:34.537: ==== Streaming Start ===============================================
10:20:16.093: [rtmp stream: 'adv_stream'] User stopped the stream
10:20:16.093: Output 'adv_stream': stopping
10:20:16.093: Output 'adv_stream': Total frames output: 31177
10:20:16.093: Output 'adv_stream': Total drawn frames: 31320
10:20:16.094: Video stopped, number of skipped frames due to encoding lag: 2654/31289 (8.5%)
10:20:16.095: ==== Streaming Stop ================================================
10:20:16.291: warning: 2 frames left in the queue on closing
10:21:42.935: ---------------------------------
10:21:42.935: video settings reset:
10:21:42.935: base resolution: 1920x1080
10:21:42.935: output resolution: 1600x900
10:21:42.935: downscale filter: Lanczos
10:21:42.935: fps: 60/1
10:21:42.935: format: NV12
10:21:42.935: YUV mode: 601/Partial
10:21:42.956: Settings changed (outputs, advanced)
10:21:42.957: ------------------------------------------------
 

carlmmii

Active Member
That's pretty definitive. Either lower your resolution or drop back to medium -- you're running into encoding limitations. Your CPU may show that it's not running 100%, but that's with skipping frames in order to meet frame timing. You're not able to reach 100% encoding capability based on your current settings.
 

DEDRICK

Member
Code:
Video stopped, number of skipped frames due to encoding lag: 2654/31289 (8.5%)

You're on the edge of being able to do it, change your Reference frames from 5 to 4 by entering the following text in the Custom x264 parameter section.

ref=4

For reference, Medium is 3, Slow is 5, 4 may help reduce encoding time just enough to not skip frames.
_______________________________________________________________________________

Before you try that though, set your PC up for to get the most out of it, if you just installed Windows 10 you're missing a lot of Ryzen tweaks.

Latest AMD AM4 Chipset Drivers - https://www2.ati.com/drivers/amd_chipset_drivers_18.10_1018.exe

Set your Power Plan to Ryzen Balanced or High Performance
(There is a difference between the two, they change how XFR and PBO work on Ryzen chips.)

Ryzens have XFR and PBO to overclock the chips over base clock of 3.7GHz. XFR is the equivalent to Intels Turbo boost, PBO is like Nvidias GPU Boost, it overclocks core automatically past the normal XFR clock. PBO is the feature that allows you to reach 4.3GHz on single and low core loads.

There's settings in your BIOS that control how high and how many cores Precision Boost Overdrive will boost, on my ASUS board it's called Performance Enhancer - Levels 1-4.
Level 2 is max AMD limits, 3 and 4 push the settings past the limits, they require watercooling, overclocking tweaks and other fun stuff and may be unstable. Level 2 is generally safe.

Ryzen Balanced lets XFR/PBO do their thing, boost single/multiple cores beyond the normal "turbo levels" based on cooling and other factors.
High Performance will all core boost at all times but disables XFR2/PBO for single/low core load overclocking. Your max clock will most likely be 3.9 or 4.0 GHz on all cores.

Encoding is an all core task so High Performance is probably best and you can ignore pretty much everything above, but you should do your research on XFR2/PBO, it is fairly new and information is mixed and they are crucial for getting the most out of your chip.

Hit Windows+i>Goto Gaming
Turn off Game Mode
Turn off Game Bar
Turn off Game Capture/DVR

In OBS>Settings>Advanced
Set the process priority to High
Set your YUV Color Matrix to 709

This section is so you don't spend cycles re-sampling your audio

OBS>Settings>Audio
48000 Hz

Windows Sound Devices/Playback and Recording
Set all of them to 48000 Hz under Properties>Advanced on each device.
 
Last edited:

koala

Active Member
You are using the slow preset, are complaining that you have lagged frames, and the log exhibits lost frames due to encoding lag.
The answer is pretty clear: The CPU is overloaded. Use some less cpu-intensive preset, such as medium, fast or faster. There is no perceivable visual difference between slow and fast, anyway.
 
Top