libvlc_media_new_path implies a file. To get media based upon URLs, use
libvlc_media_new_location. Additionally, if using a URL, it's best to
give it some playback caching/buffering, at least 100 milliseconds.
Closesjp9000/obs-studio#590
Previously, for an unknown reason p-frames were marked as highest
priority along with i-frames (keyframes), which means they could not be
dropped. This would cause a problem where if for whatever reason
there's too much congestion, data would continually buffer. This fixes
the issue by dropping p-frames at a separate (higher) threshold than
b-frames.
Measures packet data rate and sleeps to prevent data from going above
the set data rate. Uncomment the TEST_FRAMEDROPS macro, then set
DROPTEST_MAX_KBPS to the desired kb/s (for example 3000 for 3000
kilobits per second), and then it will limit the data rate to that
specified amount, forcing the thread to sleep to ensure it can only
output the desired data rate.
Causes issues with certain servers that don't parse it properly and only
expect a specific string.
Use the RTMP onMetaData to get the OBS version instead when possible.
Even if the hotkey is not enabled, always allow configuration of the
hotkey. Fixes a bug where the hotkey configuration settings would not
save if the settings were changed.
Annoyingly this means that the hotkey will still be shown to the user,
possibly confusing the user as to whether they can use it, but for the
time being it's better than having their hotkey configuration removed
each time they change the mode.
It's supposed to look for patch segments in ascending order, from the
smallest offset to the largest offset. Patch type/comparison is
identical to the one it's being swapped with, so only the offsets need
to be swapped.
(Note: This commit also modifies coreaudio-encoder, win-capture, and
win-mf modules)
This reduces logging to the user's log file. Most of the things
specified are not useful for examining log files, and make reading log
files more painful.
The things that are useful to log should be up to the front-end to
implement. The core and core plugins should have minimal mandatory
logging.
Prevents the common problem of injecting in to certain processes and
getting the hook DLL "stuck":
- windows explorer
- steam
- battle.net
- gog galaxy
- skype
- uplay
- origin
- microsoft visual studio
- task manager
- league of legends lobby window
- windows 10 system settings window
Changed the first property of game capture to be a "mode" list (with
"any fullscreen window", "specific window", and "hotkey").
When hotkey mode is set, it'll add a hotkey pair to hotkey settings to
activate/deactivate game capture. When the hotkey to activate is
pressed, it'll treat the current foreground window as the target window
similar to "selected window" mode; it'll keep trying to capture the same
window even if the window or its application closes/reopens, and will
continue to do so until deactivated via the deactivate hotkey, or until
a new window is set via the activate hotkey.
Doing something like '#if TRUE' when 'TRUE' isn't defined is the
equivalent to '#if 0' because the preprocessor evaluates an undefined
macro as 0/false.
These comments have been added to clean up the code and make it more
clear of what the code is doing. The code felt a bit messy, and this
should help prevent the original author of the noise suppression filter
from being lost in case he decides to modify/improve the filter.
When buffering audio data, we don't want to buffer audio data that may
be old. If the audio timing jumps significant and old audio data is
buffered, clear that old data.
The noise suppression filter mistakenly operated on the assumption that
input audio data would always be in 10ms segments, and would crash if
audio data was larger than that size.
Because speexdsp operates on fixed audio frame sizes only, we must
buffer audio data to fit that frame processing size. This creates a
troublesome situation where you must buffer around that specified frame
size.
The new steps for processing are:
1. Push audio data to input circular buffer.
2. Push number of audio frames and timestamp for that audio packet to an
'info' circular buffer.
3. Check size of input circular buffer, and while it's equal to or above
the speexdsp frame size (10ms for minimum latency), pop from the
input buffer to a temporary buffer (10ms frames) and process it, then
push that temporary buffer to the output circular buffer.
4. Peek at the front of the 'info' circular buffer.
5. If the output circular buffer frame size is equal or larger than next
expected number of frames, pop both the info and output buffer, and
return the audio data with the expected audio frames/timestamp.
libVLC doesn't seem to provide full speaker configuration info, so when
downmixing audio from a file that had more than 2 channels, the audio
would sound wrong.
This change makes it so that libVLC does the downmixing to stereo rather
than libobs, just due to that lack of speaker configuration info.
It seems that it is not possible to create multiple OpenGL textures
for the same window. When sources are duplicated in studio mode this
causes window capture sources to become black. The
OBS_SOURCE_DO_NOT_DUPLICATE flag prevents that this happens.
Update Restream.io ingests list and set recommended keyframe interval to
2.
(Commit edited and formatted by Jim: Fixed commit message)
Closesjp9000/obs-studio#565
Whether buffer size is visible is determined by the value of the "Use
buffer size" property (the "use_bufsize" setting).
(Commit edited and formatted by Jim: separated this code from the
previous commit, and gave it a proper commit message)
Closesjp9000/obs-studio#567
This is why macros should be used for settings strings.
(Commit edited and formatted by Jim: separated this code from the
following commit, and gave it a proper commit message)
Closesjp9000/obs-studio#567
This reverts commit 4c505e7030.
Reverting this for the time being due to issues with quakelive. This
will be more thoroughly tested and hopefully added again.
When the crop filter was changed to a crop/pad filter, the sampler state
was changed to use a transparent border for the U/V addressing mode.
However, what was not realized at the time was that the scroll filter
also shared the crop effect file, and the scroll filter depended on the
old sampler state (wrap u/v).
This fixes the issue by simply setting a u/v wrap sampler state in the
scroll filter.
Tested using FTL (steam): SwapBuffers ultimately calls wgl_swap_buffers
causing an additional copy which just isn't necessary
This also causes game capture to sometimes capture overlays even when
not intended
This reverts commit bd70e73c25.
Turns out the commit was due to a miscommunication -- the commit it was
fixing actually worked fine, and this fix was unnecessary.
If window capture fails to find a window with a matching title, search
for a window with the same window class additionally as a backup.
Replaces the third part of the internal window string with the class
name instead of the program path due to the fact that the program path
rarely seemed to work.
Allows the ability to pad in addition to cropping. Changes the name to
Crop/Pad filter.
(Additional edits by Jim: Greatly refactored/simplified filter code)
Closesjp9000/obs-studio#532
Removing this union fixes the internal compile error that would occur on
visual studio 2015 update 2 and above when these variables were all in a
union.
(Note: This commit also modifies obs-ffmpeg and obs-outputs)
API Changed:
obs_output_info::void (*stop)(void *data);
To:
obs_output_info::void (*stop)(void *data, uint64_t ts);
This fixes the long-time design flaw where obs_output_stop and the
output 'stop' callback would just shut down the output without
considering the timing of when obs_output_stop was used, discarding any
possible buffering and causing the output to get cut off at an
unexpected timing.
The 'stop' callback of obs_output_info now takes a timestamp with the
expectation that the output will use that timestamp to stop output data
in accordance to that timing. obs_output_stop now records the timestamp
at the time that the function is called and calls the 'stop' callback
with that timestamp. If needed, obs_output_force_stop will still stop
the output immediately without buffering.
Because output stop timing has been fixed, there is no need to send the
remaining packets in the queue because it now just waits for the stop
timing anyway.
Fixes a bug where if a D3D9 program recreates its device the capture
would become invalid. Certain games (especially blizzard games) will
completely recreate their Direct3D device if a critical D3D9 error
occurs.
Adds the ability to add video playlists via libvlc instead of via the
media source. This is mostly just being added as a secondary option to
the media source to reduce maintenance costs and save time. Currently
libff cannot pause/unpause/seek, and isn't programmed to handle
playlists yet.
If VLC is installed on the computer (with the same architecture) it will
allow video playback via libVLC. In the future, users should be able to
optionally download VLC libraries via the installer as well if they
don't want to necessarily install VLC to get the plugin working.
This plugin performs runtime linking instead of compile-time linking;
compiling VLC is not required, only its headers are required. To
compile, clone the VLC repository and set the VLCPath cmake variable to
point to the VLC repository directory.
The xcomposite window capture crashes were due to a few factors:
-------------------------------
1.) The source's X error handler was possibly being overwritten by
another part of the program despite us locking the display, presumably
something in Qt which isn't locking the display when pushing/popping its
own error handler (though this is not yet certain). The source's calls
to X functions happen in the graphics thread, which is separate from the
UI thread, and it was noticed that somehow the error handler would be
overwritten almost seemingly at random, indicating that something else
in the program outside of OBS code was not locking the display while
pushing/popping the error handler.
To replicate this, make it so that the source cannot find the target
window and so it continually searches for it each video_tick call, then
resize the main OBS window continually (which causes Qt to push/pop its
own error handlers). A crash will almost always occur due to BadWindow
despite our error handling.
2.) Calling X functions with a window ID that no longer exists,
particularly XGetWindowAttributes, in conjunction the unknown error
handler set in case #1 would cause the program to outright crash because
that error handler is programmed to crash on BadWindow for whatever
reason. The source would call X functions without even checking if
'win' was 0.
3.) The source stored window IDs (in JSON, even if they've long since
become invalid/pointless, such as system restarts). This is a bad
practice and will result in more cases of BadWindow.
Fixing the problem (reducing the possibility of getting BadWindow):
-------------------------------
Step 1.) Deprecate and ignore window IDs in stored settings. Instead of
using window IDs to find the window, we now must always search the
windows and find the target window via the window name exclusively.
This helps ensure that we actually consistently have a working window
ID.
Step 2.) Do not call any X functions if the window ID is 0.
Step 3.) Reset the window ID to 0 any time the window has updated, and
make the source find the window again to ensure it still exists before
attempting to use any X functions on the window ID again.
Add checks to make sure the pulseaudio operation objects are actually
valid and the request did not fail right away. Other pulseaudio
functions dealing with the objects expect them not to be NULL,
otherwise they will kill the application with a failing assert.
For some reason in the FFmpeg output, this AVCodecContext variable is
being set to 1 by FFmpeg itself somewhere, and it's causing a massive
slowdown when encoding with FFmpeg directly. This should be set to 0 to
specify to use as many threads as necessary.
This reverts commit 8d520b970d.
This can actually cause a hard lock due to the windows API when
destroying window capture. When the graphics thread locks the source
list for doing tick or render, and then the UI thread tries to destroy a
source, the UI thread will wait for the graphics thread to complete
rendering/ticking of sources. The video_tick of window capture would
then check windows in the same process and try to query the window's
name via GetWindowText. However, GetWindowText is synchronous, and will
not return until the window event has been processed by the UI thread,
so it will perpetually lock because the two threads are waiting for each
other to finish.
On windows, if you were saving a file name or directory with characters
that are not of the current windows character set, it could cause the
file saving process to fail. This fixes it so that on windows it uses
wmain and converts the unicode command line to a UTF-8 command line,
which works with FFmpeg.
Prevents game capture from acting as a global source. This fixes an
issue where a game capture in another scene could capture a window and
prevent a separate game capture in the current scene from being able to
capture that same window.
Completely shut down monitor capture when it's not being shown in the
program (for example in a different scene). This fixes an issue where
it would cause lag when a game enters fullscreen mode.
Instead of having a "cbr" setting that turns CBR on and off, adds a
"rate_control" parameter that sets the rate control method, which can be
one of the following: CBR, ABR, VBR, CRF.
If the "cbr" setting is used, it will throw a deprecation warning to the
log.
Instead of using an option that turns CBR on/off, adds rate control
methods: VBR, CBR, CQP, Lossless.
This moves lossless from being a preset to being a rate control method.
When using per-encoder rescaling, QSV would overwrite the current
encoder scale value in the get_video_info callback with the base video
width/height instead of using the current encoder width/height.
(Also modifies obs-ffmpeg to handle empty frames on EOF)
Previously the demuxer could hit EOF before the decoder threads are
finished, resulting in truncated output. In the worse case scenario the
demuxer could read small files before ff_decoder_refresh even has a chance
to start the clocks, resulting in no output at all.
There was no error checking when sending headers/metadata, so what would
happen is that if a header/metadata send failed (meaning the socket was
disconnected), it would continue to act as if it was still connected,
and it would block and lock up on the next send/recv call.
In aa4e18740a I mistakenly thought that I could add the variables
back in and that it would automatically cull variables that aren't used,
but that wasn't the case -- the shader parser always checks to see
whether parameters were set, and if they're not, it'll fail. This fixes
an issue where the shader would try to access parameters that are no
longer needed and fail due to the shader parameter check.
YUV-based shader support has been removed (due to the fact that no
sources ever use YUV shading) so there's no reason to keep around the
YUV processing code.
Currently, multiple QSV encoders cannot be active at the same time
(otherwise it will crash). This is a temporary solution to prevent
crashes from occurring when more than one QSV encoder tries to start up
at the same time.
Additionally, in the future there should be a way for encoders to be
able to communicate with the front-end when an error such as this
occurs.
If the parent source of a scroll filter has a 0 width or 0 height, the
scroll filter would do a division by zero on the size_i variable, which
would then cause the offset variable to perpetually have a non-finite
value, thus preventing the scroll filter from rendering properly after
that due to the non-finite offset value being uploaded to the shader.
(Note: this commit also modifies the obs-filters and test-input modules)
Changes the obs_source_process_filter_begin return type so that it
returns true/false to indicate that filter processing should or should
not continue (for example if the filter is bypassed or if there's some
other sort of issue that causes the filtering to fail)
When using QSV is used on a windows 7 machine with a dedicated card, you
have to fake a monitor connection to your Intel graphics to be able to
use QSV. If you do not, the initialization will fail with an error.
The error for that situation is not handled properly, and a variable
will be used while null. Instead, the function should safely return
after that error is received.
Also, do not call ClearData in the destructor unless QSV has been
properly initialized (if m_pmfxENC is null).
The if statement erroneously ended with a ';', which means that the code
is always executed, but there's no reason to even have these if checks
in the first place as the functions themselves return safely with null
pointers.