Commit graph

5147 commits

Author SHA1 Message Date
Ryan Foster b02a97ab0f libobs: Log Windows 10 Gaming Features
This commit adds logging for Windows 10 Gaming features that may
negatively impact the performance of game capture, recording, or
streaming. This doesn't check Group Policy settings.
2017-10-14 00:31:41 -04:00
Ryan Foster 0759eeb5da libobs: Add wrapper function to query Windows registry 2017-10-14 00:31:41 -04:00
Jim a76b919c6e Merge pull request #1038 from nokia/network-fix
file-updater: fix crash due to network timeout
2017-10-13 06:40:39 -07:00
jp9000 5cfefce55e obs-outputs: Only set stop events if still active
The new code in 3032535f56 would signal that the output has stopped to
the back-end and front-end, but the event used in the outputs themselves
to shut down the send thread would still be signaled, causing the next
connection to immediately stop as soon as it had started.  This fixes it
so that the event does not get signaled unless the thread is active.
2017-10-12 09:56:47 -07:00
Richard Stanway 8e66f180d8
UI: Add missing text for replay buffer hotkey log 2017-10-12 17:49:02 +02:00
Richard Stanway 5c9d3dd30d
UI: Log when starting / stopping via hotkey or timer
This will help resolve incidents where users accidentally started or
stopped their stream without knowing what triggered it (usually from
hotkeys that were forgotten about).
2017-10-12 17:23:56 +02:00
jp9000 3032535f56 obs-outputs: Signal stop if stop called when not active
Fixes a bug with reconnecting where the reconnecting would get stuck in
the "stopping" state.
2017-10-12 08:20:50 -07:00
jp9000 4330021617 decklink: Use unbuffered by default, and decouple
Use unbuffered async mode by default, and when in unbuffered mode,
decouple audio/video so that audio plays as soon as it's received.

This is a workaround for decklink device drivers having unreliable
video/audio timestamps (audio/video sync drifting over time).  From
testing, it seems that the handling of video and audio is completely
separate in the driver; along with the timestamp calculations.  For
example, when the thread of the decklink audio callback is stalled, it
would cause the timestamps of the audio alone to go out of sync, which
indicates timestamps are calculated more or less on the spot independent
of what video is doing (which is how we replicated the issue fixed by
b63e4b055e).  Because decklink drivers treats the audio and video as
essentially decoupled, we must also treat it as decoupled.  This is what
was causing video/audio to drift out of sync over time.
2017-10-10 07:04:21 -07:00
jp9000 b54f70ef8d libobs: Add async video/audio decoupling functions
Decoupling the audio from the video causes the audio to be played right
when it's received rather than attempt to sync up to the video frames.
This is useful with certain async sources/devices when the audio/video
timestamps are not reliable.

Naturally because it plays audio right when it's received, this should
only be used when the async source is operating in unbuffered mode,
otherwise the video frame timing will be out of sync by the amount of
buffering the video currently has.
2017-10-10 06:45:34 -07:00
jp9000 d768717b8c rtmp-services: Only update Twitch ingests when necessary
(This commit also modifies UI)

Instead of pinging Twitch every time the program starts up, only pings
for new servers when the ingests are actually being used, and when the
UI uses the auto-configuration dialog.

If ingests have not been cached when using the "Auto" server, it will
wait for 3 seconds max to query the Twitch ingest API.  If it takes
longer than 3 seconds or fails, it will defer to SF.  If ingests were
already cached, then it will use the existing cache immediately.
2017-10-09 10:10:59 -07:00
Ryan Foster d6ee57ae83 libobs/util: Fix Windows 10 revision detection
Follow-up to 47aa56b (PR #620). Windows 10 revision detection broke in
Build 15036 (Creators Update) after Revision 296. This aims to further
fix revision detection on Windows 10.
2017-10-08 04:16:48 -04:00
jp9000 3dc96fbe43 UI: Add ini option to use different graphics adapters
Allows setting a specific graphics adapter index to use for Direct3D 11.
This is currently meant to be sort of "undocumented" in implementing it
this way due to the fact that users will be guaranteed to break their
configurations if this is implemented in the UI (even if in advanced
settings).
2017-10-07 03:05:57 -07:00
jp9000 4494e927f7 libobs-opengl: Disable v-sync on mac
Sets the swap interval to 0 to prevent v-sync from affecting any of the
preview panes on mac.
2017-10-06 06:35:56 -07:00
jp9000 3399f7b822 libobs: Disable pulseaudio dependency lookup on mac
The cmake script code used to find and depend on pulseaudio for audio
monitoring on linux was unintentionally being triggered on mac.  This
patch makes it so that the pulseaudio cmake code is ignored on mac.
2017-10-06 05:16:27 -07:00
jp9000 720a28aeb9 UI: Log generic stream startup failures
These code paths had no logging on failure, resulting in a log file that
would confuse people attempting to perform support for users.
2017-10-06 04:52:25 -07:00
Thomas De Schampheleire 379137d039 file-updater: fix crash due to network timeout
If there is no network connection, OBS crashes after 5 minutes idling
with following crash:

*** longjmp causes uninitialized stack frame ***: obs terminated
======= Backtrace: =========
/lib64/libc.so.6(+0x6f1e3)[0x7f8f95f901e3]
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f8f96018ba7]
/lib64/libc.so.6(+0xf7add)[0x7f8f96018add]
/lib64/libc.so.6(__longjmp_chk+0x29)[0x7f8f96018a39]
/usr/lib64/libcurl.so.4(+0xa5d5)[0x7f8f979b75d5]
/lib64/libpthread.so.0(+0x10e30)[0x7f8f962cae30]
/lib64/libc.so.6(__poll+0x2d)[0x7f8f95fff46d]
/usr/lib64/libglib-2.0.so.0(+0x4a64c)[0x7f8f91b5564c]
/usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f8f91b5575c]
/usr/lib64/libQt5Core.so.5(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x5f)[0x7f8f9706c1ff]
/usr/lib64/libQt5Core.so.5(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xfa)[0x7f8f9701defa]
/usr/lib64/libQt5Core.so.5(_ZN16QCoreApplication4execEv+0x9c)[0x7f8f970258fc]
obs(main+0x5ac)[0x4773dc]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f8f95f41700]
obs(_start+0x29)[0x478389]

Internet search [1] revealed that this is a libcurl bug that can be worked
around by asking curl not to install signal handlers.

[1] https://stackoverflow.com/a/10755612
2017-10-05 13:57:27 +02:00
jp9000 a0e8c7a5c1 win-dshow: Fix video playback when default format is MJPEG
Video playback doesn't work if the default format is MJPEG and there are
other formats to use; this is because the useDefaultConfig variable is
still set to true, which overrides the format value that would normally
tell it to convert to RGB.
2017-10-04 15:58:06 -07:00
jp9000 9321b822bf vlc-video: Fix shuffle not being quite that random
This changes it so that the chooses indices at random from an index list
until the index list is exhausted.
2017-10-03 18:48:57 -07:00
jp9000 3ea23320b8 libobs: Initialize randomization seed in video thread
Ensures that any rand() calls in the video thread will have a unique
seed to start from.
2017-10-03 18:48:56 -07:00
jp9000 e5d660e944 graphics-hook: Blacklist specific game from GL capture
"Life is Feudal: Your Own" will use Direct3D to render the game, then
OpenGL to render its in-game menus, which causes a conflict with itself.
This specifically blacklists the game from capturing OpenGL to prevent
that from happening.
2017-10-02 15:29:04 -07:00
jp9000 c914c1c23b vlc-video: Set properties to defer update mode
Makes it so that the settings do not update every time the user touches
a property of the source, but instead update when the user is finished.
2017-10-02 07:36:02 -07:00
jp9000 849944ca79 libobs/media-io: Fix decompress_420 function
This function had a number of bugs and just wasn't working properly at
all.  This function is currently not used in public builds because GPU
is used for color conversion instead (hence why it had probably not
really been tested), but a need came up where CPU conversion was useful
for the sake of testing something else in the back-end, and it needed to
be fixed before CPU conversion could be used.
2017-10-02 07:36:02 -07:00
jp9000 292a6e59f4 test: Add sync tests
The async source sync test verifies that async sources are playing back
in sync properly, and the "sync pair (video)" and "sync pair (audio)"
sources test the back-end syncing down to the exact sample via inserting
audio data directly in to the back-end with system timestamps.

For these sources, when the video is white, a C sinewave should be
playing, and when the video is black audio is mute.
2017-10-02 07:36:02 -07:00
jp9000 5b20942247 win-wasapi: Subtract frame duration from timestamp
It would appear that the timestamp values returned by devices are not
perfectly accurate, and in some cases may be calculated on the spot --
to combat that, it's best to subtract the audio segment's duration from
the current audio segment's timestamp to ensure the timing is as
accurate as possible.
2017-10-02 07:36:02 -07:00
jp9000 008e38f5b6 win-capture: Remove buffering from window capture
Removes the unnecessary buffering from window capture to prevent window
capture from being one frame out of sync
2017-10-02 07:36:02 -07:00
jp9000 ef97f15d6b libobs: Set video timing_adjust to obs video time
When an async video frame comes in and it sets the timing_adjust value
(used to sync audio to video based upon their timestamps), it would use
os_gettime_ns as a base.  Instead, it should use OBS' current video
frame time so that the audio and video playback is as accurate as
possible relative to the actual exact timestamp of the video frame.
(Results are almost insignificant, but it's nice to be as precise as
possible)
2017-10-02 07:36:02 -07:00
jp9000 54e80661b6 obs-outputs: Fix up the internal FLV output
Fixes up the FLV output to ensure it functions properly.
2017-10-02 07:36:02 -07:00
jp9000 260de35be6 libobs: When interleaving packets, make video come first
During packet interleaving (for outputs), ensure that if two packets
coincide with the same timestamp, that the video packet always comes
first instead of the audio packet.

This fix is required to make FLV demux properly with certain demuxers;
some FLV demuxers expect the video packet before the audio packet when
two packets coincide with the same timestamps.
2017-10-02 07:36:02 -07:00
jp9000 8d424cf1c7 obs-outputs: Fix FLV muxing bug
The end of an FLV tag would contain the size of the tag, but the code
was erroneously including the end size value in addition, which it's not
supposed to do normally.
2017-10-02 07:36:02 -07:00
jp9000 dc1e233168 libobs: Move macro to internal C file
Modifying this value would cause the entire project to recompile when
it's only used in one file in the first place.
2017-10-02 07:36:02 -07:00
jp9000 4a5ac39749 libobs: Fix starting video packet offset in outputs
(This commit also modifies the obs-outputs module)

The first video packet video offset (the value used to set the starting
point of video data) would be set to the DTS value of the first video
packet.  However, when b-frames are used, the first DTS value will be
negative.  This was originally done because FLV muxing requires that the
first packet's DTS start from 0.  Unfortunately, this would also
effectively cause the first packet's PTS/DTS value to be shifted forward
by the negative amount, which would cause video sync to be off by a
video frame or two.

This fixes it to start at the PTS value instead and preserve any
negative offsets.  Additionally, the FLV muxing code has been fixed to
ensure that it adjusts the starting video DTS to 0, and now correctly
adjusts the first audio packet's timestamp according to that DTS as well
(which it didn't do before).
2017-10-02 07:36:02 -07:00
jp9000 2f04010a4a libobs: Fix paired audio encoder discarding one segment
On audio encoder startup, audio encoders paired with a video encoder
would unintentionally discard a single audio data segment, causing it to
be 1024 audio frames out of sync.
2017-10-02 07:36:02 -07:00
Richard Stanway 05fb67717e
UI/updater: Use TLS 1.2 with WinHTTP
On Windows 7, WinHTTP defaults to using only SSL3 and TLS 1.0. The
obsproject.com server was updated to remove TLS 1.0 support and
this has caused updates to stop working on Windows 7.
2017-10-02 15:33:34 +02:00
Richard Stanway 27d16f961b
libobs: Restore Windows Vista compatibility
Certain PSAPI functions moved to KERNEL32 after Vista, setting
PSAPI_VERSION 1 uses the old PSAPI exports for compatibility. Vista
support was unintentionally broken by a6318ff.
2017-09-28 13:28:46 +02:00
Sophie Hamilton 3feea66d16 linux-alsa: Display the "Custom" entry once only
The "Custom" device entry was added inside the loop that runs for each
device; this causes "Custom" to be added once for each device detected,
or not at all if no device was detected. Moving this outside the loop
(as would appear to have been the original intent, judging by the
indentation) fixes this by adding the entry only after all devices have
been processed.
2017-09-26 13:12:57 +01:00
jp9000 c9182a9878 obs-ffmpeg: Fix potential seek issues with media source
(This commit also modifies deps/media-playback)

Before, the media-playback library would detect whether something was
seekable by checking the filename for "://", which is unideal because
there are other cases where targets may not be seekable.  So instead, an
explicit "seekable" property (off by default) is now in place in the
media source when not in "local file" mode.  Seeking will only be
enabled if local file mode is on, or if "seekable" is explicitly checked
by the user.

Closes jp9000/obs-studio#1022
2017-09-17 05:55:56 -07:00
jp9000 8f43934be6 UI: Lock graphics context when adding new sources
Prevents a potential cross-lock deadlock.  The UI thread would lock the
scene's mutex in obs_scene_atomic_update, then the item would lock the
graphics context to create a texture.  Meanwhile in the video thread, it
could lock the graphics context in the render loop, then lock the
scene's mutex when rendering.  When doing anything graphics-related, the
graphics context is always supposed to be locked before the scene's
mutex is supposed to be locked (it's designed that way), and the
obs_scene_atomic_update would just bypass that.
2017-09-17 02:47:54 -07:00
jp9000 2386bd6556 obs-transitions: Fix integer conversion warning 2017-09-16 13:59:53 -07:00
Makeenon 006fc35a2d obs-transition: Add crossfade option to stinger
Add option in properties that let you choose how audio is mixed during
transition:
- Fade Out/Fade In (existing behavior, default)
- Crossfade

Closes jp9000/obs-studio#1028
2017-09-16 13:59:49 -07:00
Michel dab278e1b6 obs-transitions: Add audio monitoring to stinger
Closes jp9000/obs-studio#1001
2017-09-16 12:35:17 -07:00
Benjamin Schubert 9cba5660e4 UI: Enable Replay Buffer in Advanced Mode
Replay buffer is currently only supported in simple mode.  This change
adds support to advanced mode and is, for the most part, a mirror of the
addition of replay buffer to simple mode.

Mantis-bug: https://obsproject.com/mantis/view.php?id=792

Closes jp9000/obs-studio#1019
2017-09-16 05:55:18 -07:00
Jim 48cc90d5bb Merge pull request #996 from twitchalerts/audio-subsystem-crash-fix
libobs: Fix a potential divide by zero crash
2017-09-15 13:12:41 -07:00
Jim 1e1808dbd9 Merge pull request #1005 from SuslikV/patch-1
UI: Fix parent window geometry loading
2017-09-15 10:30:39 -07:00
Jim 34b0f29dc5 Merge pull request #1003 from Fenrirthviti/theme-updates
UI: Allow volume peak to be customized via .qss
2017-09-15 09:33:52 -07:00
Jimi Huotari 73c4ebc289 libobs: Adjust grammar of an error message
Change 'but both were not found' to 'but neither were found.'

Closes jp9000/obs-studio#1018
2017-09-15 08:23:58 -07:00
Jimi Huotari 068874bc3e libobs: Stop configure if ImageMagick is preferred, but not found
With certain combinations of CMake (<3.9) and ImageMagick (>=7),
configure will silently fail setting up support for ImageMagick,
even if the user requested for it, and the build will move on
(as long as FFMPEG_AVCODEC is found).  This commit adds a check
that will stop configure in such cases.

Closes jp9000/obs-studio#1018
2017-09-15 08:23:54 -07:00
Jimi Huotari fef71c4b7c libobs: Fix ImageMagick header path
Since ImageMagick 7, the header path has been changed.  This commit
implements a check for the version being used, and includes the
header as is appropriate.

Special thanks to Hu.

Mantis-Bug: https://obsproject.com/mantis/view.php?id=966

Gentoo-Bug: https://bugs.gentoo.org/627520

Closes jp9000/obs-studio#1018
2017-09-15 08:23:32 -07:00
chinasarft 1ef4de7ce3 obs-ffmpeg: Don't mark to destroy media unless valid
Closes jp9000/obs-studio#1021
2017-09-15 05:51:52 -07:00
Jim dcd3e627c2 Merge pull request #1027 from SuslikV/patch-2
UI: Add missing option to context menu
2017-09-15 04:13:28 -07:00
Christoph Hohmann 27a8f69eea UI: Use Qt standard buttons in source properties
Use the Qt standard buttons in the source properties dialog to make the
UI consistent.  Also remove the right alignment of the button box to
allow Qt to align standard buttons on the left side of the dialog.

Closes jp9000/obs-studio#1013
2017-09-15 04:05:32 -07:00