OBS branch with AMD VCE support.

jackun

Developer
For clarification:
  • D3D10 interop doesn't have anything to do with games, only with OBS as it uses D3D10 to do its magic. Ticking make OBS use CPU for NV12 conversion instead and on Win8+ DX11 engine will use NV12 textures. Dx9 and Win7 resort to using host memory for NV12 buffers.
  • Device TopoID is the 'physical' location on motherboard not device vendor ID etc. as you can have more than 1 device with same ID. Check log (window). It only affects OVE because if I'm not missing something, you can't specify device for AMF (yet). Hmm, but it could be using the device that AMF context got init'ed with. If that's the case then it uses the selected device from Video > Video Adapter.
OBS 0.637b+ 2014-10-25: 32bit, 64bit.

Previous build may have a logic error where it copies encoded data twice corrupting the bitstream.
 
Last edited:

jackun

Developer
Do you guys have any idea how raptr does their recording with VCE? Because they can do 60 FPS with 50 Mbit/s

Some custom code probably, less layers to pass through. Possibly using DEM? Tried disassembling/decompiling it once, but yeah, try to read disassembly when you're not used to it ;)

Game capture is basically the same as OBS's (hook into game, copy framebuffer to texture).
 
Last edited:

dping

Active Member
For clarification:
  • D3D10 interop doesn't have anything to do with games, only with OBS as it uses D3D10 to do its magic. Ticking make OBS use CPU for NV12 conversion instead and on Win8+ DX11 engine will use NV12 textures. Dx9 and Win7 resort to using host memory for NV12 buffers.
  • Device TopoID is the 'physical' location on motherboard not device vendor ID etc. as you can have more than 1 device with same ID. Check log (window). It only affects OVE because if I'm not missing something, you can't specify device for AMF (yet). Hmm, but it could be using the device that AMF context got init'ed with. If that's the case then it uses the selected device from Video > Video Adapter.
OBS 0.637b+ 2014-10-25: 32bit, 64bit.

Previous build may have a logic error where it copies encoded data twice corrupting the bitstream.
wb jack! Thanks for the clarification.
 

DEDRICK

Member
There is a noticeable pulse directly tied to the IDR Period when using either AMF or OVE at any quality setting.

Video 1080p/30 3500Kbps , GOP 30, IDR 60

Please refer to this twitch video to see what I mean... http://www.twitch.tv/dedrick604/b/582253047

Every 2seconds (or 60 frames) the image pulses. This occurs when the image is still or during high motion

here is the log, it's the very last one

https://gist.github.com/anonymous/ea459fa4618b8207b712

Changing the IDR to 30 makes it occur every second and of course, 120 frames makes it occur every 4 seconds. It is much less noticeable using OVE but still present
 
Last edited:

mLgz0rn

New Member
that is probably because after using DDU your driver ACTUALLY updated. I would roll it back to an older driver.
I found out what was wrong!
It was the overlay im mumble making problems.
Disabling it got it to work again
 

dping

Active Member
I found out what was wrong!
It was the overlay im mumble making problems.
Disabling it got it to work again
wow. I've had no problems with mumble overlay. I always have it on while I stream. Interesting and glad you figured it out
 

dping

Active Member
There is a noticeable pulse directly tied to the IDR...
Changing the IDR to 30 makes it occur every second and of course, 120 frames makes it occur every 4 seconds. It is much less noticeable using OVE but still present

yeah I noticed this since I started streaming with this fork. I kind of tend to ignore it but glad you brought it up for discussion.

p.s. Sorry for double post pc is broke and hard to multiquote
 

jackun

Developer
There is a noticeable pulse directly tied to the IDR Period when using either AMF or OVE at any quality setting.

Yes, this is how IDR works. IDR is a full frame and VCE is allocating bits for it (too) conservatively (or else your stream bitrate goes through the roof). As a result it is blurrier and blockier than just a stream of P/B frames.

But other than that, I get that vertically creeping blocky bands with AMF, durrr.
 
Last edited:

mLgz0rn

New Member
wow. I've had no problems with mumble overlay. I always have it on while I stream. Interesting and glad you figured it out

I'm also running Radeonpro and that also had issues to run the tweaks while the mumble overlay was running.
So I guess it could be Radeonpro together with the mumble overlay that was making the issue.
Radeonpro is also running perfectly after disabling the overlay.
 

dping

Active Member
Well at least you got a excuse and apologised for it ;D

So you are running an older build, at 8000k bitrate with IDR set to 0 (should default at every 30 frames). Its probably the bitrate that is making your stream look alright. lower it to 3500 or lower and you'll see it.

Yes, this is how IDR works. IDR is a full frame and VCE is allocating bits for it (too) conservatively (or else your stream bitrate goes through the roof). As a result it is blurrier and blockier than just a stream of P/B frames.

But other than that, I get that vertically creeping blocky bands with AMF, durrr.

Do you think you could add a section for Intra refresh for instead of IDR to test with? its supposed to slide frames in vertical columns instead of a full refresh to keep down the bitrate... I think there are a few Intra-refresh commands in h264 but might be more with VCE...

Also I dont know if you saw it, but i was wondering if you could change the way GOP and IDR are computed to multiples of the FPS? this way its always set to what it needs to be based on the FPS you stream at.
 
Last edited:

doczoidbergmd

New Member
So I tried the 2014-10-25 v0.637b+ 64bit today with VCE and Battlefield 4, It works really well in the Test range but once I started to join an online match BF4 stops working within 10 seconds while streaming.

specs:

Windows 8.1 64bit
i5 2500k
R9 290x
8GB ram

I stream in 720p/60fps and got ingame around 80fps while streaming.
 

dping

Active Member
So I tried the 2014-10-25 v0.637b+ 64bit today with VCE and Battlefield 4, It works really well in the Test range but once I started to join an online match BF4 stops working within 10 seconds while streaming.

specs:

Windows 8.1 64bit
i5 2500k
R9 290x
8GB ram

I stream in 720p/60fps and got ingame around 80fps while streaming.

Logfile please, Also are you using Mantle or DirectX? I dont think all the bugs are worked out of streaming mantle yet
 

jackun

Developer
Do you think you could add a section for Intra refresh for instead of IDR to test with? its supposed to slide frames in vertical columns instead of a full refresh to keep down the bitrate... I think there are a few Intra-refresh commands in h264 but might be more with VCE...

I've tested intra but something gets corrupted like it's missing first keyframe. Everything is gray and has the sweeping horizontal 'refresh' line visible.

But it looks like there's some need for MaxQP and MinQP controls as these even work with CBR. MaxQP at 48 helped a bit with the banding (though I did only a few minute test run). And limiting MinQP might keep bitrate from peaking even more. I'll try to post a build tomorrow.
 

UntamedLoli

New Member
I can't get AMF to work with hitbox. The stream has audio but just a black screen for video. I've tried various settings but nothing works. Local videos are fine. Unchecking AMF makes the video show up but it's pretty messed up visually. I can't see anything in the log that indicates something broke myself. I've tried the last 3-4 versions. 14.9 Drivers.
16:38:16: Open Broadcaster Software v0.637b - 64bit ( ^ω^)
16:38:16: -------------------------------
16:38:16: CPU Name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
16:38:16: CPU Speed: 3400MHz
16:38:16: Physical Memory: 16351MB Total, 9530MB Free
16:38:16: stepping id: 7, model 42, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
16:38:16: monitor 1: pos={0, 0}, size={1920, 1200}
16:38:16: Windows Version: 6.1 Build 7601 S
16:38:16: Aero is Enabled
16:38:16: -------------------------------
16:38:16: OBS Modules:
16:38:16: Base Address Module
16:38:16: 000000003F3D0000 OBS.exe
16:38:16: 00000000DBAD0000 OBSApi.dll
16:38:16: 00000000ECD80000 DShowPlugin.dll
16:38:16: 00000000ECB60000 GraphicsCapture.dll
16:38:16: 00000000EEF50000 NoiseGate.dll
16:38:16: 00000000F4050000 PSVPlugin.dll
16:38:16: ------------------------------------------
16:38:16: Adapter 1
16:38:16: Video Adapter: AMD Radeon HD 7900 Series
16:38:16: Video Adapter Dedicated Video Memory: 3202506752
16:38:16: Video Adapter Shared System Memory: 4026531840
16:38:16: Video Adapter Output 1: pos={0, 0}, size={1920, 1200}, attached=true
16:38:16: Using fixed low latency mode, factor 20
16:38:16: =====Stream Start: 2014-10-27, 16:38:16===============================================
16:38:16: Multithreaded optimizations: On
16:38:16: Base resolution: 1920x1200
16:38:16: Output resolution: 1280x800
16:38:16: ------------------------------------------
16:38:16: Loading up D3D10 on AMD Radeon HD 7900 Series (Adapter 1)...
16:38:17: ------------------------------------------
16:38:17: Audio Format: 48000 Hz
16:38:17: ------------------------------------------
16:38:17: Audio Channels: 2 Ch
16:38:17: Playback device Default
16:38:17: ------------------------------------------
16:38:17: Using desktop audio input: Speakers (Creative SB X-Fi)
16:38:17: Global Audio time adjust: 0
16:38:17: Using 5.1 speaker setup
16:38:17: ------------------------------------------
16:38:17: Audio Encoding: AAC
16:38:17: bitrate: 192
16:38:17: Using Window Capture
16:38:17: Scene buffering time set to 700
16:38:17: VCE encoding with MFT.
16:38:17: Successfully loaded ObsVCEAMF.dll
16:38:17: ObsVCEAMF.dll initialized successfully
16:38:17: Possible support for AMD VCE.
16:38:17: Build date Oct 25 2014 16:25:33
16:38:17: DX11: List of adapters:
16:38:17: 0: Device ID: 6798 [AMD Radeon HD 7900 Series]
16:38:17: AMF DX11 : Using device 0: Device ID: 6798 [AMD Radeon HD 7900 Series]
16:38:17: InitDX11() created HW DX11.1 device
16:38:17: InitDX11() created HW DX11 device
16:38:17: CL Platform Extensions: cl_khr_icd cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_amd_event_callback cl_amd_offline_devices
16:38:17: CL Device Extensions: cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_atomic_counters_32 cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_khr_image2d_from_buffer cl_khr_spir cl_khr_gl_event
16:38:17: keyin: -1
16:38:17: Rate control method:
16:38:17: Peak constrained VBR (2)
16:38:17: Quality: 10 => QP 15
16:38:17: Capabilities:
16:38:17: Accel type: HARDWARE
16:38:17: Max bitrate: 100000000
16:38:17: Levels: 10 11 12 13 20 21 22 30 31 32 40 41 42 50 51
16:38:17: Profiles: 66 77 100
16:38:17: Input mem types:
16:38:17: HOST, native: 0
16:38:17: OPENGL, native: 0
16:38:17: OPENCL, native: 0
16:38:17: DX9, native: 1
16:38:17: DX11, native: 1
16:38:17: Width min/max: 64/1920
16:38:17: Height min/max: 64/1920
16:38:17: BPicturesDeltaQP = 0
16:38:17: BPicturesPattern = 0
16:38:17: BReferenceEnable = <bool>0
16:38:17: DeBlockingFilter = <bool>1
16:38:17: EnforceHRD = <bool>0
16:38:17: EngineType = 0
16:38:17: ExtraData = <interface>
16:38:17: FillerDataEnable = <bool>1
16:38:17: FrameRate = <rate>30/1
16:38:17: FrameSize = <size>1280x800
16:38:17: GOPSize = 30
16:38:17: HalfPixel = <bool>1
16:38:17: HeaderInsertionSpacing = 0
16:38:17: IDRPeriod = 0
16:38:17: InitialVBVBufferFullness = 64
16:38:17: IntraRefreshMBsNumberPerSlot = 0
16:38:17: MaxAUSize = 0
16:38:17: MaxOfLTRFrames = 0
16:38:17: MaxQP = 51
16:38:17: MinQP = 18
16:38:17: PeakBitrate = 3150000
16:38:17: Profile = 100
16:38:17: ProfileLevel = 42
16:38:17: QPB = 15
16:38:17: QPI = 15
16:38:17: QPP = 15
16:38:17: QualityEnhancementMode = 0
16:38:17: QualityPreset = 2
16:38:17: QuarterPixel = <bool>1
16:38:17: RateControlMethod = 2
16:38:17: RateControlSkipFrameEnable = <bool>0
16:38:17: ReferenceBPicturesDeltaQP = 0
16:38:17: ScanType = 0
16:38:17: SlicesPerFrame = 1
16:38:17: TargetBitrate = 3000000
16:38:17: Usage = 0
16:38:17: VBVBufferSize = 3000000
16:38:19: Using RTMP service: hitbox.tv
16:38:19: Server selection: rtmp://live.hitbox.tv/push
16:38:19: Interface: Intel(R) 82579V Gigabit Network Connection (ethernet, 1000 mbps)
16:38:19: Completed handshake with rtmp://live.hitbox.tv/push in 244 ms.
16:38:20: SO_SNDBUF was at 8192
16:38:20: SO_SNDBUF is now 65536
16:40:08: FlushBufferedVideo: Flushing 22 packets over 700 ms
16:40:09: Total frames encoded: 3339, total frames duplicated: 1 (0.03%)
16:40:09: Total frames rendered: 3341, number of late frames: 0 (0.00%) (it's okay for some frames to be late)
16:40:09:
16:40:09: Profiler time results:
16:40:09:
16:40:09: ==============================================================
16:40:09: video thread frame - [100%] [avg time: 1.908 ms] [children: 83.8%] [unaccounted: 16.2%]
16:40:09: | scene->Preprocess - [27.9%] [avg time: 0.532 ms]
16:40:09: | GPU download and conversion - [55.9%] [avg time: 1.066 ms] [children: 55.7%] [unaccounted: 0.21%]
16:40:09: | | flush - [2.52%] [avg time: 0.048 ms]
16:40:09: | | Conversion - [53.1%] [avg time: 1.014 ms]
16:40:09: encoder thread frame - [100%] [avg time: 1.524 ms] [children: 98.6%] [unaccounted: 1.38%]
16:40:09: | Encode - [98%] [avg time: 1.494 ms] [children: 98.4%] [unaccounted: -0.328%]
16:40:09: | | Query output - [97.4%] [avg time: 1.484 ms] [children: 0.459%] [unaccounted: 96.9%]
16:40:09: | | | ProcessBitstream - [0.459%] [avg time: 0.007 ms]
16:40:09: | | Alloc surface - [0.787%] [avg time: 0.012 ms]
16:40:09: | | ProcessBitstream - [0.197%] [avg time: 0.003 ms]
16:40:09: | sending stuff out - [0.591%] [avg time: 0.009 ms]
16:40:09: ==============================================================
16:40:09:
16:40:09:
16:40:09: Profiler CPU results:
16:40:09:
16:40:09: ==============================================================
16:40:09: video thread frame - [cpu time: avg 0.308 ms, total 1029.61 ms] [avg calls per frame: 1]
16:40:09: | scene->Preprocess - [cpu time: avg 0.004 ms, total 15.6 ms] [avg calls per frame: 1]
16:40:09: | GPU download and conversion - [cpu time: avg 0.056 ms, total 187.202 ms] [avg calls per frame: 1]
16:40:09: | | flush - [cpu time: avg 0.023 ms, total 78 ms] [avg calls per frame: 1]
16:40:09: | | Conversion - [cpu time: avg 0.028 ms, total 93.602 ms] [avg calls per frame: 1]
16:40:09: encoder thread frame - [cpu time: avg 0.343 ms, total 1138.81 ms] [avg calls per frame: 1]
16:40:09: | Encode - [cpu time: avg 0.305 ms, total 1014.01 ms] [avg calls per frame: 1]
16:40:09: | | Query output - [cpu time: avg 0.305 ms, total 1014.01 ms] [avg calls per frame: 1]
16:40:09: | | | ProcessBitstream - [cpu time: avg 0.018 ms, total 62.4 ms] [avg calls per frame: 1]
16:40:09: | | Alloc surface - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 0]
16:40:09: | | ProcessBitstream - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 0]
16:40:09: | sending stuff out - [cpu time: avg 0.009 ms, total 31.2 ms] [avg calls per frame: 1]
16:40:09: ==============================================================
16:40:09:
16:40:09: =====Stream End: 2014-10-27, 16:40:09=================================================
16:40:09: ~RTMPPublisher: Packet flush completed in 133 ms
16:40:09: ~RTMPPublisher: Send thread terminated in 0 ms
16:40:09: RTMPPublisher::SocketLoop: Graceful loop exit
16:40:09: ~RTMPPublisher: Socket thread terminated in 50 ms
16:40:09: ~RTMPPublisher: Final socket shutdown completed in 80 ms
16:40:09: Average send payload: 6840 bytes, average send interval: 50 ms
16:40:09: Number of times waited to send: 0, Waited for a total of 0 bytes
16:40:09: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
16:40:09: Number of bytes sent: 14843286
16:40:20: Terminating 0x3c04
 
Top