Commit Graph

211 Commits (76fcfa9ed368234138552c931c9b0e671d3481a3)

Author SHA1 Message Date
Matt Gajownik ccd1ef2bd0 win-dshow: Set current working directory in VirtualCam scripts 2020-09-15 19:58:02 +10:00
jp9000 e86b8241f3 win-dshow: Fix bug determining closest audio config
This fixes the remaining bugs that were still present when trying to fix
audio-related crashes with AJA devices.
2020-09-07 18:05:54 -07:00
jp9000 072a886453 win-dshow: Add "activate" proc to proc handler 2020-09-07 16:12:50 -07:00
jp9000 57c21e3cb9 win-dshow: Fix 24bit audio not being detected correctly 2020-09-07 15:26:01 -07:00
jp9000 1538b6909f win-dshow: Fix AJA devices crashing 2020-09-07 14:14:40 -07:00
Jim 86147d9719
Merge pull request #3415 from jpark37/default-color-space
Unify color space settings as 709
2020-09-07 13:29:44 -07:00
jpark37 b6afaceeae Update VIDEO_CS_DEFAULT to mean 709 instead of 601
Consistent with modified default UI setting.
2020-09-06 20:51:28 -07:00
Joel Bethke a94ede6d00 win-dshow: Add VirtualCam installer scripts
This adds two batch scripts to install and uninstall the virtual cam
devices for installations where the installer could not be used.  Most
commonly, this is for portable installations or those who prefer the
.zip file.
2020-09-06 18:04:44 -07:00
jp9000 da8192544b win-dshow: Use cmake-based GUID for virtualcam 2020-09-06 17:04:06 -07:00
Richard Stanway 288a84dc95 win-dshow: Add file description for virtual camera DLL 2020-08-29 03:04:44 +02:00
Richard Stanway 21fb1e770e win-dshow: Use constant reference for virtualcam CLSID 2020-08-29 02:46:03 +02:00
Richard Stanway 4c08c7bfa4 win-dshow: Reduce size of virtualcam placeholder image 2020-08-29 02:42:03 +02:00
jp9000 3691dc536d win-dshow: Fix virtual camera filter name
The filter name is supposed to be "OBS Virtual Camera"
2020-07-20 14:22:49 -07:00
Clayton Groeneveld f4223ad061 win-dshow: Fix virtual camera enable bug 2020-07-20 06:02:16 -05:00
jp9000 6377fe3177 win-dshow: Add Virtual Camera (Windows)
The virtual camera adds the ability to use the output of OBS itself as a
camera that can be selected within other Windows applications.  This is
very loosely based upon the catxfish virtual camera plugin design.

There is a shared memory queue, but instead of having 10-20 frames in
the queue, there are now only 3 frames in the queue to minimize latency
and reduce memory usage.  The third frame is mostly to ensure that
writing does not occur on the same frame being read; the delay is merely
one frame at all times.

The frames of the shared memory queue are NV12 instead of YUYV, which
reduces the memory and data copied, as well as eliminate unnecessary
conversion from NV12.  Some programs (such as chrome, which uses webrtc
to capture) do not support NV12 however, so an I420 conversion is
provided, which is far less expensive than YUYV.  The CPU cost of NV12
-> I420 is negligible in comparison.

The virtual camera filter itself is based upon the output filter within
the libdshowcapture library, which was originally implemented for other
purposes.  This is more ideal than the Microsoft example code because
for one, it's far less convoluted, two, allows us to be able to
customize the filter to our needs a bit more easily, and three, has much
better RAII.  The Microsoft CBaseFilter/etc code comprised of about 30
source files, where as the output filter comprises of two or three
required source files which we already had, so it's a huge win to
compile time.

Scaling is avoided whenever possible to minimize CPU usage.  When the
virtual camera is activated in OBS, the width, height, and frame
interval are saved, that way if the filter is activated, it will always
remember the last OBS resolution/interval that the virtual camera was
activated with, even if OBS is not active.  If for some reason the
filter activates before OBS starts up, and OBS starts up with a
different resolution, it will use simple point scaling intermittently,
and then will remember the new scaling in the future.  The scaler could
use some optimization.  FFmpeg was not opted for because the FFmpeg DLLs
would have to be provided for both architectures, which would be about
30 megabytes in total, and would make writing the plugin much more
painful.  Thus a simple point scaling algorithm is used, and scaling is
avoided whenever possible.

(If another willing participant wants to have a go at improving the
scaling then go for it.  But otherwise, it avoids scaling whenever
possible anyway, so it's not a huge deal)
2020-07-07 06:09:59 -07:00
jp9000 7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Colin Edwards 55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Gol-D-Ace d74fc65047 Update translations from Crowdin 2020-03-16 20:14:50 +01:00
jp9000 40817331d3 win-dshow: Fix rotation not working in all cases 2020-03-07 06:48:07 -08:00
jp9000 07089873fc win-dshow: Add support for devices that relay rotation
Adds support for devices that can relay rotation, such as the Logitech
StreamCam.
2020-03-01 03:42:46 -08:00
jpark37 9eeef48b5a win-dshow: Fix upside-down RGB DIBs
Fix regression to RGB DIB orientation according to MSDN.
2020-01-13 21:50:54 -08:00
jpark37 3f58810b0e libdshowcapture: Update to latest submodule 2019-12-08 14:52:00 -08:00
Jim c36e3fbc92
Merge pull request #2196 from jpark37/ffmpeg-mjpeg-spam
win-dshow: Suppress MJPEG error spam
2019-11-29 20:48:40 -08:00
jpark37 f685322a0f win-dshow: Suppress MJPEG error spam
Only print the first message for this known benign error.
2019-11-24 23:59:27 -08:00
Clayton Groeneveld 82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
jpark37 f896c773e8 win-dshow: Support bottom-up DIBs
The biHeight field can be negative, leading to crashes on some cards
like VisionRGB-E1S. Adding flip support is fairly straightforward.

There also appears to be a hack to automatically flip for RGB formats,
but I wish to remove it because it seems to fight with this change. We
already have a separate vertical flip checkbox to deal with non
compliant behavior.
2019-11-12 17:59:59 -08:00
wanhongqing 9b4d9c6788 win-dshow: Fix format switching issue
If the format was one encoded format and changes to another encoded
format, it could cause it to continue to treat it as the old format.
2019-11-12 14:37:32 -08:00
Matt Gajownik 51be039cf8 CMake: Build Windows modules with file descriptors 2019-10-15 21:34:12 +11:00
jp9000 eee40ec6d6 win-dshow: Do not allow H264 to have same priority as MJPEG
This prevents VideoFormat::Any from unintentionally selecting H264 when
MJPEG is the only other format available.

This fixes a bug where certain devices (Logitech C920 with latest
drivers) will only have H264 and MJPEG available, and using
VideoFormat::Any will then select H264 over MJPEG because it's the first
format value and has the same priority as MJPEG.  So now, MJPEG will be
prioritized over H264 instead.
2019-09-19 00:12:07 -07:00
jp9000 6f1cb5a8f8 win-dshow: Disable HW decode in DirectShow for now
This did not get enough testing, so disable it for now until more
devices can be tested (especially the live gamer portable).
2019-09-18 18:14:22 -07:00
Gol-D-Ace 03b5be75e4 Update translations from Crowdin 2019-09-17 23:21:00 +02:00
jpark37 f60b820fee win-dshow: Fix color range when using FFmpeg decode
Full color range seems to be active when decoding video with FFMmpeg
even when partial is explicitly selected. This should keep the range
synchronized.
2019-09-14 17:12:29 -07:00
jp9000 deaeb5e632 win-dshow: Use unbuffered by default for MJPEG
Due to the recent change of using FFmpeg to decode MJPEG, MJPEG was
getting included in the delayed device check.  This fixes that so that
it doesn't.  MJPEG can decode in real time.
2019-07-29 20:34:13 -07:00
jp9000 cd6e9e34b8 win-dshow: Clarify function name/purpose
IsEncoded is meant to be used to indicated delayed devices, such as
older Elgato devices, or Hauppauge device.  Devices that use H264 and
have a 800+ millisecond latency.  This changes the function name to
better indicate that.
2019-07-29 20:34:13 -07:00
jp9000 68a5a40df9 libobs, obs-ffmpeg, win-dshow: Fix FFmpeg 4.0 deprecation
Fixes FFmpeg 4.0 deprecation warnings.
2019-07-29 20:34:13 -07:00
jp9000 a3fface27f win-dshow, obs-ffmpeg: Add hardware decoding support
Fixes hardware decoding support and updates it to FFmpeg 4.0.
2019-07-29 20:34:13 -07:00
James Park 0e7eec8f2d win-dshow: Use FFmpeg for MJPEG decompression
Measured lower CPU usage and latency than default DirectShow filter.
Tested with Logitech BRIO camera at 4K, 30 FPS.
2019-07-25 20:11:44 -07:00
James Park 37f663a789 libobs: obs-ffmpeg: win-dshow: Planar 4:2:2 video
This format has been seen when using FFmpeg MJPEG decompression.
2019-07-25 20:11:37 -07:00
jp9000 cdb7cd80f6 win-dshow: Update libdshowcapture to 0.6.1 2019-07-20 20:24:52 -07:00
Jim ffcfe4c9d9
Merge pull request #1951 from jpark37/audio-buffering
Fix audio buffering for devices like GV-USB2
2019-07-20 17:05:27 -07:00
jpark37 1fc0a357d2 win-dshow: Add "Default" color range setting
VIDEO_RANGE_DEFAULT uses partial range for YUV and full range for RGB.
Previous default was always partial.
2019-07-10 23:40:53 -07:00
James Park 534c553b23 win-dshow: Decouple audio from video
If a device produces video and audio timestamps atdifferent rates,
this divergence can cause massive buffering on the audio side, leading
to a capped audio buffer, and total sound loss. This change allows a
hardcoded list of devices to use the existing decoupling logic. For
now, only "GV-USB2" has been added.

When combined with another fix, 5+ hours of stable audio without any
buffering on my GV-USB2 where it used to drop sound completely after
an hour or so.

Partially fixes https://obsproject.com/mantis/view.php?id=1269
2019-07-05 09:12:57 -07:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
Gol-D-Ace 973bc481ce Update translations from Crowdin 2019-06-11 01:42:42 +02:00
sorayuki f67e63b1c6
win-dshow: fix issue decoding some H.264 stream
Logitech C920 web camera will output YUVJ420P which is not supported yet.
2019-05-05 16:18:16 +08:00
James Park a86710ec5b libobs: Support limited color range for RGB/Y800 sources
libobs: Add support for limited to full color range conversions when
using RGB or Y800 formats, and move RGB converison for Y800 formats to
the GPU.

decklink: Stop hiding color space/range properties for RGB formats, and
remove "YUV" from "YUV Color Space" and "YUV Color Range".

win-dshow: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

UI: Remove "YUV" from "YUV Color Space" and "YUV Color Range".
2019-04-25 15:13:05 -07:00
jp9000 7d136c3ce1 decklink, win-dshow: Use obs_source_output_video2
Allows the ability to override and use partial range RGB with the
DirectShow and Decklink device sources when partial range RGB is
implemented.  Fixes certain cases where devices could capture RGB in
limited range via HDMI (per the HDMI specs).
2019-04-25 15:12:33 -07:00
Gol-D-Ace 9fc1069e9b Remove double spaces from localization 2019-04-08 16:02:32 +02:00
Gol-D-Ace e78ac5ebef Update translations from Crowdin 2019-04-04 16:19:51 +02:00
Richard Stanway 0bf09160e5 win-dshow: Update libdshowcapture for crash fix 2019-03-25 17:16:21 +01:00