This commit fixes the case of two recently added attributes of the
v4l2_data struct (in PR #2978). The new attributes were named
"frameRateUnchanged" and "resolutionUnchanged", i.e. using CamelCase
while all other attributes use snake_case. This change changes the
name of the two attributes to snake_case.
Simplify UI options by combining LookAhead Depth and Async Depth into
latency mode option. Ultra-low, low, and normal will set these two
encode parameters accordingly.
This change breaks the tying of the 'close' option to the media
source being a local file vs. network source. In doing so, it is
possible to keep network sources streaming continuously, which
fixes a few things when using network cameras as sources:
* The preview pane works in studio mode.
* There is no delay in switching scenes before video appears.
* The multiview works properly/normally.
This does introduce one bit of weirdness which could be easily fixed
with sufficient knowledge of OBS to do it quickly: if a networked media
source fails with both 'Restart playback when source becomes active' and
'Close file when inactive' disabled, it is slightly tricky to get it to
restart the video stream. (It can be done by enabling those options and
hiding the scene, though.) It would be nice to have a simple "restart
stream" button somewhere to do this more easily.
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)
(Note: This commit also modifies deps/media-playback)
Co-authored-by: Eric Lindvall <eric@5stops.com>
Co-authored-by: Ryan Foster <RytoEX@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
Automatically generate directories if slashes are present in a recording
name format set in advanced settings or in the replay buffer
prefix/suffix settings.
Fixesobsproject/obs-studio#2416Closesobsproject/obs-studio#2858
* cybergame.tv - Servers and website gone (defunct)
* castr AU - DNS resolution fails
* stream.live - Defunct by the looks of it (dns fail, website broken)
Reorganize data to avoid best practices layer warning. Sort of a false
positive in our case because we only have one buffer per pool now, but
implicit layers should be clean citizens.