OBS branch with AMD VCE support.

sneaky4oe

Member
In dota 2 match I was experiencing some high bitrate spikes of 20k, while my stream was set up to 6k.
FullHD 60FPS. HD7870, stream to gaminglive. When those high bitreate spikes were there, the game was in the middle of something and "high CPU load".
My upload is 100 mbit/s. Screen capture.
 

dping

Active Member
In dota 2 match I was experiencing some high bitrate spikes of 20k, while my stream was set up to 6k.
FullHD 60FPS. HD7870, stream to gaminglive. When those high bitreate spikes were there, the game was in the middle of something and "high CPU load".
My upload is 100 mbit/s. Screen capture.

A while back, I posted a PowerPoint that I believe were using your exact specs. 6000 bit-rate, 1080@60fps. I'm wondering if you could try using its settings for a stricter CBR (they were using VBR)
6000k bitrate; buffer: 100kb <---buffers one frame at a time
custom encoding settings: intra-refresh=true <---fixes quality since only buffering one frame looses quality
IDR: 60 <---sets key frames interval to 1 second (even though other streaming services say set to 120)
GOP: 30 <--- Sets a max distance between IDR frames

set VCE profile to speed preset. openCL or MFT not sure which still works with the 08/31 build.


I will try this when I get home and see if it works better now.


EDIT: didn't work right. at least at half the bitrate :/

EDIT2: Lower the GOP size to some multiple of your fps. i.e. I set the GOP to EDIT:16 to test my theory and it worked! This will allow a less bitrate peaks. I just tested this but haven't checked the quality of the stream. with this. I will update when I have.
 
Last edited:

dping

Active Member
@jackun To test the peak bitrate of CBR, I modified a batch file based on a a random number generator in combo with a random color generator. Then I stream it in windowed mode (make sure the window is up in the background) then set obs to always on top and hit preview and watch the bit-rate fly up!


This should peak (with all absolution) the bitrate to the highest it will go, and should be the final test for a truly strict CBR.

With my current config, the bitrate peaks at 5,500kbps. before I adjusted the GOP (as stated above) it was peaking out somewhere in the range of 117,000kbps range. yes over 100mbps.
EDIT: after restarting OBS, it stayed at 5,500kbps
EDIT2: after restarting OBS again, it said 87,000kbps, so now I'm confused with the results

In contrast, x264 stays stable at just 5 kbits above what I set CBR to.


WARNING! do not use this code if you are prone to seizures!!!

Code:
echo off
title Stream Test
MODE CON COLS=1280 LINES=720
:begin
color 10
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 20
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 30
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 40
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 50
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 60
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 70
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 80
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color 90
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color a0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color b0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color c0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color d0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color e0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
color f0
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
goto :begin
 
Last edited:

KaziQ

New Member
So if i understand you correctly, you want to record at 60FPS but if the FPS incame go down so does the FPS in the file or what?
For what purpose and whats the point exactly?

Are you talking about Constant Frame Rate? Uncheck CFR, that is an OBS setting not just this fork. not usings CRF also means that any video you record, wont be as compatible when editing or maybe even uploading. Not sure, just know what I've read about CFR

The point is I don't want to miss any frame that's rendered. Constant frame rate means my computer can render 25 frames and 30 FPS recording will have fillers which will cause stutters. I just want to watch a video as it is rendered on the computer. And for compatibility issues, don't worry about it. There are software out there that can edit variable frame rate videos. Also I didn't say make it default or the only option. Make it an option. If anyone likes to use it should be able to use it. For games, it just makes sense to have variable frame rate.

KazIQ
 

jackun

Developer
@jackun To test the peak bitrate of CBR, I modified a batch file based on a a random number generator in combo with a random color generator. Then I stream it in windowed mode (make sure the window is up in the background) then set obs to always on top and hit preview and watch the bit-rate fly up!

This should peak (with all absolution) the bitrate to the highest it will go, and should be the final test for a truly strict CBR.

Should be nice test, heh.

These peaks should just occur after little to no motion/change in captured frames. CBR padding is faking it a bit and adds filler NALs manually so that stable minimum bitrate that OBS shows can be a bit misleading because encoder has no idea it is being added. So encoder tracks its own VBV (or HRD buffer) fullness and increases bitrate until VBV buffer is full-ish again and then drops to set maximum bitrate again, i think.

But i'm looking at AMD's own AMF API. If not MFT, then atleast that seems to have a 'Enforce HRD' option. Maybe that can keep max bitrate at, well, max bitrate.
 
Last edited:

dping

Active Member
Should be nice test, heh.

These peaks should just occur after little to no motion/change in captured frames. CBR padding is faking it a bit and adds filler NALs manually so that stable minimum bitrate that OBS shows can be a bit misleading because encoder has no idea it is being added. So encoder tracks its own VBV (or HRD buffer) fullness and increases bitrate until VBV buffer is full-ish again and then drops to set maximum bitrate again, i think.

But i'm looking at AMD's own AMF API. If not MFT, then atleast that seems to have a 'Enforce HRD' option. Maybe that can keep max bitrate at, well, max bitrate.


I might set up a LAN RTMP server to test with for future builds of yours, or stream directly to my Rasberry Pi or something
 

CodeBlackGames

New Member
whats wrong with yours? maybe settings to high?

just so you all know, the quality doesn't have to be great when streaming at high fps because the high fps tricks ppl in thinking you are using more quality than you are, so low quality 720@60 should be fine. it'll look decent with at least 3000bitrate
Recordings are just stuttery no matter what I do. I've just come to accept that even if I get a constant 60fps, the recording might be a laggy. Perhaps I'll try the non-VCE version and see if it works better.

I'd describe my problem like this...

Let's say "F" represents a smooth and "S" represents a skipped frame...

It's like:
F-F-F-F-F-F-F-F-S-F-F-F-F-F-F-F-F

It's smooth, then a frame is skipped, then goes back to being smooth.
 
Last edited:

dping

Active Member
I know this doesn't have anything to do with OBS-VCE, but Valve just updated Steam beta to include in-home streaming using VCE. I streamed at 1080p60fps with sub 40ms from end to end. framerate was around 59.75fps most of the time but quality sucked (speed preset I'd assume). Bitrate was no more that 6mbps and it seemed to use VBR.


EDIT: @jackun they seem to be using media sdk 1.1

amf-component-vce-windesktop64.dll was one of the new files I found in my steam folder when looked :)
 
Last edited:

OliverMD

Member
I streamed at 1080p60fps. framerate was around 59.75fps most of the time but quality sucked (speed preset I'd assume). Bitrate was no more that 6mbps and it seemed to use VBR.
EDIT: @jackun they seem to be using media sdk 1.1
Why in the hell would they use such a low bitrate?! I understand the preset cuz 1080p@60FPS, but not even remotly the bitrate.
No suprise @SDK if you ask me..would at least explain why they took so long to add the VCE support and why just now.
 

dping

Active Member
Why in the hell would they use such a low bitrate?! I understand the preset cuz 1080p@60FPS, but not even remotly the bitrate.
No suprise @SDK if you ask me..would at least explain why they took so long to add the VCE support and why just now.
I set it to use up to 30mbps but it didn't nearly get there. I think I peaked at 16mbps though after looking again.
 

KaziQ

New Member
Recordings are just stuttery no matter what I do. I've just come to accept that even if I get a constant 60fps, the recording might be a laggy. Perhaps I'll try the non-VCE version and see if it works better.

I'd describe my problem like this...

Let's say "F" represents a smooth and "S" represents a skipped frame...

It's like:
F-F-F-F-F-F-F-F-S-F-F-F-F-F-F-F-F

It's smooth, then a frame is skipped, then goes back to being smooth.

Hi,

There will be frames skipped all the time that's why I asked for 1:1 recording. You can come up with multiple scenarios that generate that outcome. For 30 FPS every 33.3 ms there is a frame captured. Say GPU rendered 3 frames then 2 is lost. If there was variable frame rate it would be amazing and the best solution for gamers.

KaziQ
 

OliverMD

Member
I set it to use up to 30mbps but it didn't nearly get there. I think I peaked at 16mbps though after looking again.
Really weird when you think about how the bitrate is sky rocketing even at 720p when you only use the CPU for encoding.
Oh well it's just a beta release, can only hope they fix it soon which i bet they will. Everything starts small in the beginning.

EDIT: God damn it, OBS keeps crashing my driver for some reason. Slowly starting think that it's an Replay only issue.
 
Last edited:

Red Eye Jedi

New Member
First off I would like to say thanks to jackun for this awesome fork. Now I'm having problems with recording in MFT. I can record desktop and window capture but whenever I try to record with game capture on a fullscreen game I get an error regarding the encoder. If I run the game in window mode it does work however.
Code:
01:34:05: VCE encoding with MFT.
01:34:05: Encoder could not be found
01:34:05: ---------------------
01:34:05: WARNING: HW encoder not found, Using SW encoder.!!!
01:34:05:
01:34:05: Selected SW Encoder to encode the stream
01:34:05:  Error code : 0x80004005
01:34:05: Failed to set output type to encoder @ M:\dev\OBS\ObsVCEMFT\inc\MftUtils.h 878
01:34:05:
01:34:05:  Error code : 0x80004005
01:34:05: Failed to create encoder transform
01:34:05: Couldn't initialize encoder

OVE mode works without any problems except when I'm streaming I get random dropped frames and spikes in bitrate. And suggestions would be great.
 

dping

Active Member
Code:
 Couldn't initialize encoder

What OS, and version of OBS (dates are used to identify), 32 or 64bit.

You can't have both MFT and OpenCL for NV conversion checked at the same time. either way, have you tried, starting stream with a window capture then changing to a fullscreen game capture? Also, what else do you have checked in your game capture? any anti cheating hook? I'm just asking cuz I dont have an issues with this at all.
 

Red Eye Jedi

New Member
What OS, and version of OBS (dates are used to identify), 32 or 64bit.

You can't have both MFT and OpenCL for NV conversion checked at the same time. either way, have you tried, starting stream with a window capture then changing to a fullscreen game capture? Also, what else do you have checked in your game capture? any anti cheating hook? I'm just asking cuz I dont have an issues with this at all.

Windows 7 x64. Tried both 32 bit and 64 bit v0.63b test build 3 using Release 64/32bit build (2014-08-31). Well when I check use MFT it disables the OpenCL for NV option so there was no way I could use it. On the game capture I have nothing checked. I will try switching to game capture after I start in window.

EDIT: It worked starting the recording with monitor capture then switching to game capture. Weird
 
Last edited:

jackun

Developer
MFT has a D3DAware attribute, but that is set further down from finding the encoder. Maybe encoder makes use of DX9/DX11 device on its own before that and for some reason fails if game got its hands on it first.

But (edit: about the new) AMF SDK has these props:
EnforceHRD FALSE // Disables/Enables constraints on QP variation within a
// picture to meet HRD requirements (TRUE/FALSE)​
FillerDataEnable FALSE // Enables filler data to handle decoder buffer overflow (TRUE/FALSE)
// Works only with CBR rate control mode​

But it seems it (edit: new AMF libs) needs newer drivers than Cat 14.4 (well, I couldn't get it to work, running on some haxed 14.8).

Edit: Gave myself a scare there a bit that filler option didn't work, but then i saw that VBR was enabled not CBR, doh. Now to understand how the hell AMF buffer/surface reuse works and see if 'EnforceHRD' works too. IsReusable() is true but crashes on second use half way into copying a new frame, hmm.
 
Last edited:

dping

Active Member
MFT has a D3DAware attribute, but that is set further down from finding the encoder. Maybe encoder makes use of DX9/DX11 before that and for some reason fails to access it.

But AMF SDK has these props:


But it seems it needs newer drivers than Cat 14.4 (well, I couldn't get it to work, running on some haxed 14.8).
Would 14.7 not work? can go get 14.8, I just like to stick with somewhat official driver sets
 

TheIcon

Member
t8x5iv.jpg


I set my bit rate to 1000kbps, which is proper for my connection. However at times I see it exceeds that. I highlighted it on the screenshot with the orange border, even though I set it for 1000kbps, which I am getting 1328? I start to loose frames when it exceeds about 1700kbps.

Thanks
 
Top