Vhonowslend / StreamFX-Public

StreamFX is a plugin for OBS® Studio which adds many new effects, filters, sources, transitions and encoders! Be it 3D Transform, Blur, complex Masking, or even custom shaders, you'll find it all here.
https://s.xaymar.com/streamfx-dc
GNU General Public License v2.0
3.92k stars 2.92k forks source link

Shader filters applied to video input devices resize before show/hide transitions if device not at canvas resolution #578

Closed FoxKeegan closed 3 years ago

FoxKeegan commented 3 years ago

Operating System

Windows 10 1903 and higher

OBS Studio Version?

27.0 (including Release Candidates)

StreamFX Version

0.10.1

Expected Behavior

When you attempt to show/hide the video input device, the image should simply cycle through the shader's transition effect, then vanish or appear, all while staying centered within the confines of the device's designated area on the OBS canvas. (Source border indicated by the blue/red resizable box)

Current Behavior

All of the expected behavior with one significant difference: just prior to the start of the transition effect, the image is scaled to the OBS "Base (Canvas) Resolution" proportional to any resizing the Source border has already had applied.

Steps to Reproduce the Bug

  1. Take any video capture device and apply the StreamFX shader filter to either the show or hide transition.
  2. Ensure the resolution used by the video capture device does not match the OBS base (canvas) resolution.
  3. Attempt to show or hide the video capture device, thus triggering the transition

Example: If the canvas was 1920x1080 and the camera was set to 1080, no erroneous effects would be noticed. However, if--for example--said camera was switched to 720 in OBS, the next time it was made to be shown or hidden, the image would be scaled up from its current adjustments proportional to how large it would be at 1080, then the effect would take place. To better explain the last part: if the image was made to encompass the entire canvas at 1080, then switched to 720 and not manually resized/scaled in any fashion, if the transition were to take effect it would do so while the image was now encompassing the entire screen again, as it would have been scaled back up to 1080. If, however, the 720 image had been manually scaled down by 50%, when the device was hidden, the image would still scale up to 1080, becoming larger, but would now no longer encompass the entire screen--it would be proportionally smaller. (50%)

OBS Studio Log

Log ``` 14:23:40.482: CPU Name: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz 14:23:40.482: CPU Speed: 3696MHz 14:23:40.482: Physical Cores: 6, Logical Cores: 12 14:23:40.482: Physical Memory: 49075MB Total, 31131MB Free 14:23:40.482: Windows Version: 10.0 Build 18363 (release: 1909; revision: 1440; 64-bit) 14:23:40.482: Running as administrator: true 14:23:40.482: Aero is Enabled (Aero is always on for windows 8 and above) 14:23:40.482: Windows 10 Gaming Features: 14:23:40.482: Game Bar: Off 14:23:40.482: Game DVR: Off 14:23:40.482: Game DVR Background Recording: Off 14:23:40.482: Game Mode: On 14:23:40.483: Sec. Software Status: 14:23:40.483: Windows Defender Antivirus: enabled (AV) 14:23:40.483: Windows Firewall: disabled (FW) 14:23:40.484: Current Date/Time: 2021-06-11, 14:23:40 14:23:40.484: Browser Hardware Acceleration: true 14:23:40.484: Portable mode: false 14:23:40.744: OBS 27.0.0-rc6 (64-bit, windows) 14:23:40.744: --------------------------------- 14:23:40.777: --------------------------------- 14:23:40.777: audio settings reset: 14:23:40.777: samples per sec: 48000 14:23:40.777: speakers: 2 14:23:40.777: --------------------------------- 14:23:40.777: Initializing D3D11... 14:23:40.777: Available Video Adapters: 14:23:40.779: Adapter 0: Radeon RX 590 Series 14:23:40.779: Dedicated VRAM: 4273823744 14:23:40.779: Shared VRAM: 4254928896 14:23:40.779: PCI ID: 1002:67df 14:23:40.779: Driver Version: 27.20.14501.18003 14:23:40.779: output 0: pos={0, 0}, size={1920, 1080}, attached=true, refresh=60, name=VW246 14:23:40.779: output 1: pos={0, -1080}, size={1920, 1080}, attached=true, refresh=60, name=VW246 14:23:40.779: output 2: pos={1920, 0}, size={1280, 1024}, attached=true, refresh=60, name=Rad-9 14:23:40.780: Loading up D3D11 on adapter Radeon RX 590 Series (0) 14:23:40.809: D3D11 loaded successfully, feature level used: b000 14:23:40.809: DXGI increase maximum frame latency success 14:23:40.809: D3D11 GPU priority setup success 14:23:41.167: --------------------------------- 14:23:41.167: video settings reset: 14:23:41.167: base resolution: 1920x1080 14:23:41.167: output resolution: 1920x1080 14:23:41.167: downscale filter: Bilinear 14:23:41.167: fps: 30/1 14:23:41.167: format: NV12 14:23:41.167: YUV mode: 709/Partial 14:23:41.167: NV12 texture support enabled 14:23:41.167: Audio monitoring device: 14:23:41.167: name: Out 1-2 (MOTU M Series) 14:23:41.167: id: {0.0.0.00000000}.{f2427f01-e4e0-4657-8a15-c3118b172702} 14:23:41.169: --------------------------------- 14:23:41.169: Skipping module '../../obs-plugins/64bit/chrome_elf.dll', not an OBS plugin 14:23:41.171: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded 14:23:41.171: Failed to load 'en-US' text for module: 'decklink-captions.dll' 14:23:41.172: Failed to load 'en-US' text for module: 'decklink-ouput-ui.dll' 14:23:41.357: [AMF] Version 2.7.0 loaded (Compiled: 1.4.14.0, Runtime: 1.4.18.0, Library: 1;4;18;0;20.45.01.14;202011131446;CL#2201722). 14:23:41.388: [AMF] Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11) 14:23:41.425: [AMF] Unable to set converter transfer characteristic, error AMF_NOT_FOUND (code 11) 14:23:41.434: [AMF] [Capability Manager] Testing Direct3D 11 Adapter 'Radeon RX 590 Series (VEN_1002/DEV_67df/SUB_c4111462/REV_00e1)': 14:23:41.434: H264/AVC: Supported 14:23:41.434: H265/HEVC: Supported 14:23:41.434: 14:23:41.439: Skipping module '../../obs-plugins/64bit/libcef.dll', not an OBS plugin 14:23:41.443: Skipping module '../../obs-plugins/64bit/libEGL.dll', not an OBS plugin 14:23:41.443: Skipping module '../../obs-plugins/64bit/libGLESv2.dll', not an OBS plugin 14:23:41.446: [obs-browser]: Version 2.14.3 14:23:41.446: [obs-browser]: CEF Version 75.1.16+g16a67c4+chromium-75.0.3770.100 14:23:41.449: [noise suppress: Nvidia RTX denoiser disabled, redistributable not found] 14:23:41.812: [StreamFX] Loading Version 0.10.1.0-gc8484f65 14:23:41.816: LoadLibrary failed for 'nvcuda.dll': The specified module could not be found. 14:23:41.816: (126) 14:23:41.816: [StreamFX] Failed to load 'nvcuda.dll'. 14:23:41.816: [StreamFX] Loaded Version 0.10.1.0-gc8484f65 14:23:41.818: VLC found, VLC video source enabled 14:23:41.822: A DeckLink iterator could not be created. The DeckLink drivers may not be installed 14:23:41.823: No blackmagic support 14:23:41.826: --------------------------------- 14:23:41.826: Loaded Modules: 14:23:41.826: win-wasapi.dll 14:23:41.826: win-mf.dll 14:23:41.826: win-dshow.dll 14:23:41.826: win-decklink.dll 14:23:41.826: win-capture.dll 14:23:41.826: vlc-video.dll 14:23:41.826: text-freetype2.dll 14:23:41.826: StreamFX.dll 14:23:41.826: rtmp-services.dll 14:23:41.826: obs-x264.dll 14:23:41.826: obs-vst.dll 14:23:41.826: obs-transitions.dll 14:23:41.826: obs-text.dll 14:23:41.826: obs-qsv11.dll 14:23:41.826: obs-outputs.dll 14:23:41.826: obs-filters.dll 14:23:41.826: obs-ffmpeg.dll 14:23:41.826: obs-browser.dll 14:23:41.826: image-source.dll 14:23:41.826: frontend-tools.dll 14:23:41.826: enc-amf.dll 14:23:41.826: decklink-ouput-ui.dll 14:23:41.826: decklink-captions.dll 14:23:41.826: coreaudio-encoder.dll 14:23:41.826: --------------------------------- 14:23:41.826: ==== Startup complete =============================================== 14:23:41.832: All scene data cleared 14:23:41.832: ------------------------------------------------ 14:23:41.861: Switched to scene 'Scene' 14:23:41.861: ------------------------------------------------ 14:23:41.861: Loaded scenes: 14:23:41.861: - scene 'Scene': 14:23:41.861: - source: 'C920#1' (dshow_input) 14:23:41.861: - source: 'C920#2' (dshow_input) 14:23:41.861: - source: 'N660P' (dshow_input) 14:23:41.861: - source: 'Genius' (dshow_input) 14:23:41.861: - source: 'USB HDMI Capture' (dshow_input) 14:23:41.861: - source: 'Animaze' (dshow_input) 14:23:41.861: ------------------------------------------------ 14:23:41.968: --------------------------------- 14:23:41.968: [DShow Device: 'C920#2'] settings updated: 14:23:41.968: video device: Logitech C920 #2 14:23:41.968: video path: \\?\usb#vid_046d&pid_08e5&mi_00#6&7a74ca5&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global 14:23:41.968: resolution: 1280x720 14:23:41.968: flip: 0 14:23:41.968: fps: 30.00 (interval: 333333) 14:23:41.968: format: MJPEG 14:23:41.978: --------------------------------- 14:23:41.978: [DShow Device: 'Animaze'] settings updated: 14:23:41.978: video device: Animaze Virtual Camera 14:23:41.978: video path: \\?\root#image#0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global 14:23:41.978: resolution: 1264x720 14:23:41.978: flip: 0 14:23:41.978: fps: 30.00 (interval: 333333) 14:23:41.978: format: YUY2 14:23:42.069: [StreamFX] Automatic checks at launch are now enabled. 14:24:18.794: --------------------------------- 14:24:18.794: [DShow Device: 'C920#2'] settings updated: 14:24:18.794: video device: Logitech C920 #2 14:24:18.794: video path: \\?\usb#vid_046d&pid_08e5&mi_00#6&7a74ca5&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global 14:24:18.794: resolution: 1280x720 14:24:18.794: flip: 0 14:24:18.794: fps: 30.00 (interval: 333333) 14:24:18.794: format: MJPEG 14:25:06.552: ==== Shutting down ================================================== 14:25:07.084: All scene data cleared 14:25:07.084: ------------------------------------------------ 14:25:07.169: [StreamFX] Unloading Version 0.10.1.0-gc8484f65 14:25:07.176: [StreamFX] Unloaded Version 0.10.1.0-gc8484f65 14:25:07.192: [Scripting] Total detached callbacks: 0 14:25:07.250: Freeing OBS context data 14:25:07.270: == Profiler Results ============================= 14:25:07.270: run_program_init: 1935.02 ms 14:25:07.270: ┣OBSApp::AppInit: 14.612 ms 14:25:07.271: ┃ ┗OBSApp::InitLocale: 1.707 ms 14:25:07.271: ┗OBSApp::OBSInit: 1905.9 ms 14:25:07.271: ┣obs_startup: 2.221 ms 14:25:07.271: ┗OBSBasic::OBSInit: 1611.27 ms 14:25:07.271: ┣OBSBasic::InitBasicConfig: 0.346 ms 14:25:07.271: ┣OBSBasic::ResetAudio: 0.104 ms 14:25:07.271: ┣OBSBasic::ResetVideo: 390.633 ms 14:25:07.271: ┣OBSBasic::InitOBSCallbacks: 0.005 ms 14:25:07.271: ┣OBSBasic::InitHotkeys: 0.031 ms 14:25:07.271: ┣obs_load_all_modules: 657.445 ms 14:25:07.271: ┃ ┣obs_init_module(coreaudio-encoder.dll): 0.7 ms 14:25:07.271: ┃ ┣obs_init_module(decklink-captions.dll): 0.019 ms 14:25:07.271: ┃ ┣obs_init_module(decklink-ouput-ui.dll): 0.554 ms 14:25:07.271: ┃ ┣obs_init_module(enc-amf.dll): 260.86 ms 14:25:07.271: ┃ ┣obs_init_module(frontend-tools.dll): 3.01 ms 14:25:07.271: ┃ ┣obs_init_module(image-source.dll): 0.005 ms 14:25:07.271: ┃ ┣obs_init_module(obs-browser.dll): 0.299 ms 14:25:07.271: ┃ ┣obs_init_module(obs-ffmpeg.dll): 0.339 ms 14:25:07.271: ┃ ┃ ┗nvenc_check: 0.329 ms 14:25:07.271: ┃ ┣obs_init_module(obs-filters.dll): 0.05 ms 14:25:07.271: ┃ ┣obs_init_module(obs-outputs.dll): 0.005 ms 14:25:07.271: ┃ ┣obs_init_module(obs-qsv11.dll): 336.564 ms 14:25:07.271: ┃ ┣obs_init_module(obs-text.dll): 0.122 ms 14:25:07.271: ┃ ┣obs_init_module(obs-transitions.dll): 0.005 ms 14:25:07.271: ┃ ┣obs_init_module(obs-vst.dll): 0.001 ms 14:25:07.271: ┃ ┣obs_init_module(obs-x264.dll): 0.001 ms 14:25:07.271: ┃ ┣obs_init_module(rtmp-services.dll): 0.731 ms 14:25:07.271: ┃ ┣obs_init_module(StreamFX.dll): 3.835 ms 14:25:07.271: ┃ ┣obs_init_module(text-freetype2.dll): 0.025 ms 14:25:07.271: ┃ ┣obs_init_module(vlc-video.dll): 0.852 ms 14:25:07.271: ┃ ┣obs_init_module(win-capture.dll): 1.868 ms 14:25:07.271: ┃ ┣obs_init_module(win-decklink.dll): 0.99 ms 14:25:07.271: ┃ ┣obs_init_module(win-dshow.dll): 1.153 ms 14:25:07.271: ┃ ┣obs_init_module(win-mf.dll): 0 ms 14:25:07.271: ┃ ┣obs_init_module(win-wasapi.dll): 0.01 ms 14:25:07.271: ┃ ┗reset_win32_symbol_paths: 0.076 ms 14:25:07.271: ┣OBSBasic::ResetOutputs: 1.08 ms 14:25:07.271: ┣OBSBasic::CreateHotkeys: 0.281 ms 14:25:07.271: ┣OBSBasic::InitService: 1.494 ms 14:25:07.271: ┣OBSBasic::InitPrimitives: 0.248 ms 14:25:07.271: ┗OBSBasic::Load: 41.491 ms 14:25:07.271: obs_hotkey_thread(25 ms): min=0.001 ms, median=0.003 ms, max=16.108 ms, 99th percentile=0.14 ms, 100% below 25 ms 14:25:07.271: audio_thread(Audio): min=0 ms, median=0.015 ms, max=2.267 ms, 99th percentile=0.321 ms 14:25:07.271: obs_graphics_thread(33.3333 ms): min=0.026 ms, median=1.285 ms, max=20.591 ms, 99th percentile=4.024 ms, 100% below 33.333 ms 14:25:07.271: ┣tick_sources: min=0.001 ms, median=0.009 ms, max=15.526 ms, 99th percentile=0.139 ms 14:25:07.271: ┣output_frame: min=0.02 ms, median=0.801 ms, max=3.357 ms, 99th percentile=2.612 ms 14:25:07.271: ┃ ┗gs_context(video->graphics): min=0.019 ms, median=0.801 ms, max=3.357 ms, 99th percentile=2.612 ms 14:25:07.271: ┃ ┣render_video: min=0.004 ms, median=0.648 ms, max=3.121 ms, 99th percentile=2.428 ms 14:25:07.271: ┃ ┃ ┗render_main_texture: min=0.002 ms, median=0.645 ms, max=3.119 ms, 99th percentile=2.424 ms 14:25:07.271: ┃ ┗gs_flush: min=0.012 ms, median=0.163 ms, max=0.381 ms, 99th percentile=0.238 ms 14:25:07.271: ┗render_displays: min=0 ms, median=0.465 ms, max=18.061 ms, 99th percentile=1.596 ms 14:25:07.271: ================================================= 14:25:07.271: == Profiler Time Between Calls ================== 14:25:07.271: obs_hotkey_thread(25 ms): min=24.842 ms, median=25.899 ms, max=41.938 ms, 29.656% within ±2% of 25 ms (0% lower, 70.344% higher) 14:25:07.271: obs_graphics_thread(33.3333 ms): min=24.088 ms, median=33.333 ms, max=42.579 ms, 99.8449% within ±2% of 33.333 ms (0.0775494% lower, 0.0775494% higher) 14:25:07.271: ================================================= 14:25:07.287: Number of memory leaks: 34 ```

OBS Studio Crash Log

Any additional Information we need to know?

I can be contacted in the StreamFX Discord under "Fox" if you require additional information. Thank you.

FoxKeegan commented 3 years ago

I've learned that using the crop/pad filter will also cause this problem, even if you're matching the resolution of the camera to the canvas size.

Xaymar commented 3 years ago

For your interest, you should use the "Upload last log file" functionality in OBS Studio, instead of pasting it into the field. That's why it's a single line.

Xaymar commented 3 years ago

Failed to reproduce with the steps provided. I have tried with every virtual and physical Video Capture Device option, and none of them have this behavior. The only way to get this to happen is with Show/Hide transition set to Shader, which at the current time is not supported anyway. That would be a new feature request to support Show/Hide transitions for Shaders.

Xaymar commented 3 years ago

Closing in favor of #586.